From e400134a93cd4a4081a9e39a413100c7d4161086 Mon Sep 17 00:00:00 2001 From: itsscb Date: Mon, 9 Oct 2023 00:39:43 +0200 Subject: [PATCH 01/15] rf/moves ListSessions from sql.account to sql.session --- bff/db/query/account.sql | 6 +----- bff/db/query/session.sql | 7 ++++++- bff/db/sqlc/account.sql.go | 37 ------------------------------------- bff/db/sqlc/session.sql.go | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/bff/db/query/account.sql b/bff/db/query/account.sql index 04012e4..58780f7 100644 --- a/bff/db/query/account.sql +++ b/bff/db/query/account.sql @@ -80,8 +80,4 @@ RETURNING *; -- name: DeleteAccount :exec DELETE FROM accounts -WHERE "id" = $1; - --- name: ListSessions :many -SELECT * FROM sessions -WHERE email = sqlc.arg(email) AND is_blocked = false AND expires_at > now(); \ No newline at end of file +WHERE "id" = $1; \ No newline at end of file diff --git a/bff/db/query/session.sql b/bff/db/query/session.sql index 3e34026..56df86d 100644 --- a/bff/db/query/session.sql +++ b/bff/db/query/session.sql @@ -19,4 +19,9 @@ WHERE id = $1 LIMIT 1; UPDATE sessions SET "is_blocked" = true -WHERE "id" = sqlc.arg(id); \ No newline at end of file +WHERE "id" = sqlc.arg(id); + + +-- name: ListSessions :many +SELECT * FROM sessions +WHERE email = sqlc.arg(email) AND is_blocked = false AND expires_at > now(); \ No newline at end of file diff --git a/bff/db/sqlc/account.sql.go b/bff/db/sqlc/account.sql.go index 7d6cb09..7edfb08 100644 --- a/bff/db/sqlc/account.sql.go +++ b/bff/db/sqlc/account.sql.go @@ -259,43 +259,6 @@ func (q *Queries) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]A return items, nil } -const listSessions = `-- name: ListSessions :many -SELECT id, email, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions -WHERE email = $1 AND is_blocked = false AND expires_at > now() -` - -func (q *Queries) ListSessions(ctx context.Context, email string) ([]Session, error) { - rows, err := q.db.QueryContext(ctx, listSessions, email) - if err != nil { - return nil, err - } - defer rows.Close() - items := []Session{} - for rows.Next() { - var i Session - if err := rows.Scan( - &i.ID, - &i.Email, - &i.UserAgent, - &i.ClientIp, - &i.RefreshToken, - &i.IsBlocked, - &i.ExpiresAt, - &i.CreatedAt, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - const updateAccount = `-- name: UpdateAccount :one UPDATE accounts SET diff --git a/bff/db/sqlc/session.sql.go b/bff/db/sqlc/session.sql.go index 8bfce7c..dec44e4 100644 --- a/bff/db/sqlc/session.sql.go +++ b/bff/db/sqlc/session.sql.go @@ -92,3 +92,40 @@ func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error) ) return i, err } + +const listSessions = `-- name: ListSessions :many +SELECT id, email, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions +WHERE email = $1 AND is_blocked = false AND expires_at > now() +` + +func (q *Queries) ListSessions(ctx context.Context, email string) ([]Session, error) { + rows, err := q.db.QueryContext(ctx, listSessions, email) + if err != nil { + return nil, err + } + defer rows.Close() + items := []Session{} + for rows.Next() { + var i Session + if err := rows.Scan( + &i.ID, + &i.Email, + &i.UserAgent, + &i.ClientIp, + &i.RefreshToken, + &i.IsBlocked, + &i.ExpiresAt, + &i.CreatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} From 9a38296d905779292993a98bb9a95d26b8db6fb3 Mon Sep 17 00:00:00 2001 From: itsscb Date: Mon, 9 Oct 2023 02:26:20 +0200 Subject: [PATCH 02/15] ft/adds gapi.payments --- bff/db/mock/store.go | 2 +- bff/db/query/payment.sql | 5 +- bff/db/sqlc/payment.sql.go | 12 +- bff/db/sqlc/payment_test.go | 19 - bff/db/sqlc/querier.go | 2 +- bff/doc/swagger/df.swagger.json | 639 +++++++++++++++++++++-------- bff/gapi/converter.go | 19 + bff/gapi/rpc_create_payment.go | 112 +++++ bff/gapi/rpc_list_accounts.go | 2 +- bff/gapi/rpc_list_payments.go | 71 ++++ bff/gapi/rpc_list_sessions.go | 34 +- bff/gapi/rpc_update_payment.go | 116 ++++++ bff/pb/payment.pb.go | 317 ++++++++++++++ bff/pb/rpc_create_payment.pb.go | 325 +++++++++++++++ bff/pb/rpc_list_accounts.pb.go | 28 +- bff/pb/rpc_list_payments.pb.go | 224 ++++++++++ bff/pb/rpc_list_sessions.pb.go | 53 +-- bff/pb/rpc_update_payment.pb.go | 323 +++++++++++++++ bff/pb/service_df.pb.go | 262 +++++++----- bff/pb/service_df.pb.gw.go | 493 +++++++++++++++++----- bff/pb/service_df_grpc.pb.go | 185 +++++++-- bff/proto/payment.proto | 35 ++ bff/proto/rpc_create_payment.proto | 45 ++ bff/proto/rpc_list_accounts.proto | 2 +- bff/proto/rpc_list_payments.proto | 34 ++ bff/proto/rpc_list_sessions.proto | 11 +- bff/proto/rpc_update_payment.proto | 42 ++ bff/proto/service_df.proto | 87 +++- 28 files changed, 2970 insertions(+), 529 deletions(-) create mode 100644 bff/gapi/rpc_create_payment.go create mode 100644 bff/gapi/rpc_list_payments.go create mode 100644 bff/gapi/rpc_update_payment.go create mode 100644 bff/pb/payment.pb.go create mode 100644 bff/pb/rpc_create_payment.pb.go create mode 100644 bff/pb/rpc_list_payments.pb.go create mode 100644 bff/pb/rpc_update_payment.pb.go create mode 100644 bff/proto/payment.proto create mode 100644 bff/proto/rpc_create_payment.proto create mode 100644 bff/proto/rpc_list_payments.proto create mode 100644 bff/proto/rpc_update_payment.proto diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index 13b6cef..25683ca 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -601,7 +601,7 @@ func (mr *MockStoreMockRecorder) ListMails(arg0, arg1 any) *gomock.Call { } // ListPayments mocks base method. -func (m *MockStore) ListPayments(arg0 context.Context, arg1 db.ListPaymentsParams) ([]db.Payment, error) { +func (m *MockStore) ListPayments(arg0 context.Context, arg1 int64) ([]db.Payment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListPayments", arg0, arg1) ret0, _ := ret[0].([]db.Payment) diff --git a/bff/db/query/payment.sql b/bff/db/query/payment.sql index 767216a..a3f726c 100644 --- a/bff/db/query/payment.sql +++ b/bff/db/query/payment.sql @@ -21,9 +21,8 @@ INSERT INTO payments ( -- name: ListPayments :many SELECT * FROM payments -ORDER BY "payment_category" -LIMIT $1 -OFFSET $2; +WHERE "account_id" = sqlc.arg(account_id) +ORDER BY "payment_category"; -- name: UpdatePayment :one UPDATE payments diff --git a/bff/db/sqlc/payment.sql.go b/bff/db/sqlc/payment.sql.go index ac64b44..63b9ddc 100644 --- a/bff/db/sqlc/payment.sql.go +++ b/bff/db/sqlc/payment.sql.go @@ -115,18 +115,12 @@ func (q *Queries) GetPayment(ctx context.Context, id int64) (Payment, error) { const listPayments = `-- name: ListPayments :many SELECT id, account_id, payment_category, bankname, "IBAN", "BIC", paypal_account, paypal_id, payment_system, type, creator, created, changer, changed FROM payments +WHERE "account_id" = $1 ORDER BY "payment_category" -LIMIT $1 -OFFSET $2 ` -type ListPaymentsParams struct { - Limit int32 `json:"limit"` - Offset int32 `json:"offset"` -} - -func (q *Queries) ListPayments(ctx context.Context, arg ListPaymentsParams) ([]Payment, error) { - rows, err := q.db.QueryContext(ctx, listPayments, arg.Limit, arg.Offset) +func (q *Queries) ListPayments(ctx context.Context, accountID int64) ([]Payment, error) { + rows, err := q.db.QueryContext(ctx, listPayments, accountID) if err != nil { return nil, err } diff --git a/bff/db/sqlc/payment_test.go b/bff/db/sqlc/payment_test.go index afa8124..3ed7b15 100644 --- a/bff/db/sqlc/payment_test.go +++ b/bff/db/sqlc/payment_test.go @@ -126,22 +126,3 @@ func TestUpdatePayment(t *testing.T) { require.Equal(t, person1.PaymentCategory, person2.PaymentCategory) require.NotEqual(t, person1.Bankname, person2.Bankname) } - -func TestListPayments(t *testing.T) { - for i := 0; i < 10; i++ { - createRandomPayment(t) - } - - arg := ListPaymentsParams{ - Limit: 5, - Offset: 5, - } - - persons, err := testQueries.ListPayments(context.Background(), arg) - require.NoError(t, err) - require.Len(t, persons, 5) - - for _, person := range persons { - require.NotEmpty(t, person) - } -} diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index caf647c..e825160 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -60,7 +60,7 @@ type Querier interface { ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error) ListDocuments(ctx context.Context, arg ListDocumentsParams) ([]Document, error) ListMails(ctx context.Context, arg ListMailsParams) ([]Mail, error) - ListPayments(ctx context.Context, arg ListPaymentsParams) ([]Payment, error) + ListPayments(ctx context.Context, accountID int64) ([]Payment, error) ListPersons(ctx context.Context, arg ListPersonsParams) ([]Person, error) ListProviders(ctx context.Context, arg ListProvidersParams) ([]Provider, error) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index c992b58..d201f12 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -26,45 +26,7 @@ "application/json" ], "paths": { - "/v1/block_session": { - "patch": { - "operationId": "df_BlockSession", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/pbBlockSessionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "Block a Session", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pbBlockSessionRequest" - } - } - ], - "tags": [ - "df" - ], - "security": [ - { - "BearerAuth": [] - } - ] - } - }, - "/v1/create_account": { + "/v1/accounts/create_account": { "post": { "operationId": "df_CreateAccount", "responses": { @@ -97,45 +59,7 @@ ] } }, - "/v1/create_person": { - "post": { - "operationId": "df_CreatePerson", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/pbCreatePersonResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "Create an Person", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pbCreatePersonRequest" - } - } - ], - "tags": [ - "df" - ], - "security": [ - { - "BearerAuth": [] - } - ] - } - }, - "/v1/get_account": { + "/v1/accounts/get_account": { "get": { "operationId": "df_GetAccount", "responses": { @@ -171,7 +95,7 @@ ] } }, - "/v1/list_accounts": { + "/v1/accounts/list_accounts": { "get": { "operationId": "df_ListAccounts", "responses": { @@ -214,14 +138,14 @@ ] } }, - "/v1/list_sessions": { - "get": { - "operationId": "df_ListSessions", + "/v1/accounts/update_account": { + "patch": { + "operationId": "df_UpdateAccount", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/pbListSessionsResponse" + "$ref": "#/definitions/pbUpdateAccountResponse" } }, "default": { @@ -233,10 +157,51 @@ }, "parameters": [ { - "name": "email", - "in": "query", + "name": "body", + "description": "Update an Account", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/pbUpdateAccountRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/accounts/update_account_privacy": { + "patch": { + "operationId": "df_UpdateAccountPrivacy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateAccountPrivacyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Update the Privacy Consent of an Account", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateAccountPrivacyRequest" + } } ], "tags": [ @@ -282,7 +247,231 @@ ] } }, - "/v1/refresh_token": { + "/v1/payments/create_payment": { + "post": { + "operationId": "df_CreatePayment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreatePaymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Create an Payment", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreatePaymentRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/payments/list_payments": { + "get": { + "operationId": "df_ListPayments", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListPaymentsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "accountId", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/payments/update_payment": { + "patch": { + "operationId": "df_UpdatePayment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdatePaymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Update an Payment", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdatePaymentRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/persons/create_person": { + "post": { + "operationId": "df_CreatePerson", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreatePersonResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Create an Person", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreatePersonRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/sessions/block_session": { + "patch": { + "operationId": "df_BlockSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbBlockSessionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Block a Session", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbBlockSessionRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/sessions/list_sessions/{accountId}": { + "get": { + "operationId": "df_ListSessions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListSessionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "accountId", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/sessions/refresh_token": { "post": { "operationId": "df_RefreshToken", "responses": { @@ -314,82 +503,6 @@ "df" ] } - }, - "/v1/update_account": { - "patch": { - "operationId": "df_UpdateAccount", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/pbUpdateAccountResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "Update an Account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pbUpdateAccountRequest" - } - } - ], - "tags": [ - "df" - ], - "security": [ - { - "BearerAuth": [] - } - ] - } - }, - "/v1/update_account_privacy": { - "patch": { - "operationId": "df_UpdateAccountPrivacy", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/pbUpdateAccountPrivacyResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "description": "Update the Privacy Consent of an Account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pbUpdateAccountPrivacyRequest" - } - } - ], - "tags": [ - "df" - ], - "security": [ - { - "BearerAuth": [] - } - ] - } } }, "definitions": { @@ -591,6 +704,65 @@ "description": "Returns the created Account", "title": "Created Account" }, + "pbCreatePaymentRequest": { + "type": "object", + "example": { + "account_id": "1", + "payment_category": "TBD: paypal", + "paypal_account": "john.doe@example.com", + "paypal_id": "this-is-a-paypal-id", + "payment_system": "TBD: paypal system", + "type": "TBD: some type" + }, + "properties": { + "accountId": { + "type": "string", + "format": "int64" + }, + "paymentCategory": { + "type": "string" + }, + "bankname": { + "type": "string" + }, + "IBAN": { + "type": "string" + }, + "BIC": { + "type": "string" + }, + "paypalAccount": { + "type": "string" + }, + "paypalId": { + "type": "string" + }, + "paymentSystem": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "description": "Create an Payment", + "title": "Create Payment", + "required": [ + "accountId", + "paymentCategory", + "paymentSystem", + "type" + ] + }, + "pbCreatePaymentResponse": { + "type": "object", + "properties": { + "payment": { + "$ref": "#/definitions/pbPayment" + } + }, + "description": "Returns the created Payment", + "title": "Created Payment" + }, "pbCreatePersonRequest": { "type": "object", "example": { @@ -667,7 +839,7 @@ "pbListAccountsResponse": { "type": "object", "properties": { - "account": { + "accounts": { "type": "array", "items": { "type": "object", @@ -678,10 +850,24 @@ "description": "Returns the Account", "title": "ListAccounts Response" }, + "pbListPaymentsResponse": { + "type": "object", + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbPayment" + } + } + }, + "description": "Returns the Payment", + "title": "ListPayments Response" + }, "pbListSessionsResponse": { "type": "object", "properties": { - "session": { + "sessions": { "type": "array", "items": { "type": "object", @@ -749,6 +935,73 @@ }, "title": "Login Response" }, + "pbPayment": { + "type": "object", + "example": { + "id": "1", + "account_id": "1", + "payment_category": "TBD: paypal", + "paypal_account": "john.doe@example.com", + "paypal_id": "this-is-a-paypal-id", + "payment_system": "TBD: paypal system", + "type": "TBD: some type", + "creator": "john.doe@example.com", + "created": "2023-10-05T02:30:53Z", + "changer": "john.doe@example.com", + "changed": "2023-10-05T02:30:53Z" + }, + "properties": { + "id": { + "type": "string", + "format": "int64" + }, + "accountId": { + "type": "string", + "format": "int64" + }, + "paymentCategory": { + "type": "string" + }, + "bankname": { + "type": "string" + }, + "IBAN": { + "type": "string" + }, + "BIC": { + "type": "string" + }, + "paypalAccount": { + "type": "string" + }, + "paypalId": { + "type": "string" + }, + "paymentSystem": { + "type": "string" + }, + "type": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + }, + "changer": { + "type": "string" + }, + "changed": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + } + }, + "title": "Payment" + }, "pbPerson": { "type": "object", "example": { @@ -990,6 +1243,62 @@ "description": "Returns the updated Account", "title": "Updated Account" }, + "pbUpdatePaymentRequest": { + "type": "object", + "example": { + "id": "1", + "payment_category": "TBD: paypal", + "paypal_account": "john.doe@example.com", + "paypal_id": "this-is-a-paypal-id", + "payment_system": "TBD: paypal system", + "type": "TBD: some type" + }, + "properties": { + "id": { + "type": "string", + "format": "int64" + }, + "paymentCategory": { + "type": "string" + }, + "bankname": { + "type": "string" + }, + "IBAN": { + "type": "string" + }, + "BIC": { + "type": "string" + }, + "paypalAccount": { + "type": "string" + }, + "paypalId": { + "type": "string" + }, + "paymentSystem": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "description": "Update an Payment", + "title": "Update Payment", + "required": [ + "id" + ] + }, + "pbUpdatePaymentResponse": { + "type": "object", + "properties": { + "payment": { + "$ref": "#/definitions/pbPayment" + } + }, + "description": "Returns the updated Payment", + "title": "Updated Payment" + }, "protobufAny": { "type": "object", "properties": { diff --git a/bff/gapi/converter.go b/bff/gapi/converter.go index 04a66dd..6b96c41 100644 --- a/bff/gapi/converter.go +++ b/bff/gapi/converter.go @@ -57,3 +57,22 @@ func convertSession(session db.Session) *pb.Session { IsBlocked: session.IsBlocked, } } + +func convertPayment(payment db.Payment) *pb.Payment { + return &pb.Payment{ + Id: payment.ID, + AccountId: payment.AccountID, + PaymentCategory: payment.PaymentCategory, + Bankname: &payment.Bankname.String, + IBAN: &payment.IBAN.String, + BIC: &payment.BIC.String, + PaypalAccount: &payment.PaypalAccount.String, + PaypalId: &payment.PaypalID.String, + PaymentSystem: &payment.PaymentSystem.String, + Type: payment.Type, + Creator: payment.Creator, + Created: timestamppb.New(payment.Created), + Changer: payment.Changer, + Changed: timestamppb.New(payment.Changed), + } +} diff --git a/bff/gapi/rpc_create_payment.go b/bff/gapi/rpc_create_payment.go new file mode 100644 index 0000000..ea36c1f --- /dev/null +++ b/bff/gapi/rpc_create_payment.go @@ -0,0 +1,112 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + db "github.com/itsscb/df/bff/db/sqlc" + "github.com/itsscb/df/bff/pb" + "github.com/itsscb/df/bff/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRequest) (*pb.CreatePaymentResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateCreatePaymentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccount(ctx, req.GetAccountId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.NotFound, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + arg := db.CreatePaymentParams{ + AccountID: req.GetAccountId(), + PaymentCategory: req.GetPaymentCategory(), + Bankname: sql.NullString{ + Valid: req.GetBankname() != "", + String: req.GetBankname(), + }, + IBAN: sql.NullString{ + Valid: req.GetIBAN() != "", + String: req.GetIBAN(), + }, + BIC: sql.NullString{ + Valid: req.GetBIC() != "", + String: req.GetBIC(), + }, + PaypalAccount: sql.NullString{ + Valid: req.GetPaypalAccount() != "", + String: req.GetPaypalAccount(), + }, + PaypalID: sql.NullString{ + Valid: req.GetPaypalId() != "", + String: req.GetPaypalId(), + }, + PaymentSystem: sql.NullString{ + Valid: req.GetPaymentSystem() != "", + String: req.GetPaymentSystem(), + }, + Type: req.GetType(), + Creator: authPayload.Email, + Changer: authPayload.Email, + } + + payment, err := server.store.CreatePayment(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to create payment") + } + + rsp := &pb.CreatePaymentResponse{ + Payment: convertPayment(payment), + } + + return rsp, nil +} + +func validateCreatePaymentRequest(req *pb.CreatePaymentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + // TODO: #80 Add Validations to rpc_create_payment + if req.GetAccountId() < 1 { + violations = append(violations, fieldViolation("account_id", errors.New("must be greater than 0"))) + } + + if err := val.ValidateEmail(req.GetPaypalAccount()); err != nil { + violations = append(violations, fieldViolation("paypal_account", err)) + } + + // if err := val.ValidateName(req.GetPaymentCategory()); err != nil { + // violations = append(violations, fieldViolation("payment_category", err)) + // } + + // if err := val.ValidateName(req.GetBankname()); err != nil { + // violations = append(violations, fieldViolation("bankname", err)) + // } + + // if err := val.ValidateAlphaSpace(req.GetIBAN()); err != nil { + // violations = append(violations, fieldViolation("IBAN", err)) + // } + + // if err := val.ValidateAlphaSpace(req.GetBIC()); err != nil { + // violations = append(violations, fieldViolation("BIC", err)) + // } + + return violations +} diff --git a/bff/gapi/rpc_list_accounts.go b/bff/gapi/rpc_list_accounts.go index aec09c1..b3dc934 100644 --- a/bff/gapi/rpc_list_accounts.go +++ b/bff/gapi/rpc_list_accounts.go @@ -46,7 +46,7 @@ func (server *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequ } rsp := &pb.ListAccountsResponse{ - Account: accounts, + Accounts: accounts, } return rsp, nil diff --git a/bff/gapi/rpc_list_payments.go b/bff/gapi/rpc_list_payments.go new file mode 100644 index 0000000..6f2ce92 --- /dev/null +++ b/bff/gapi/rpc_list_payments.go @@ -0,0 +1,71 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequest) (*pb.ListPaymentsResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateListPaymentsRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + if account.ID != req.GetAccountId() { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + dbPayments, err := server.store.ListPayments(ctx, req.GetAccountId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Error(codes.NotFound, "no payments found") + } + return nil, status.Error(codes.NotFound, "failed to get payments") + } + + var payments []*pb.Payment + for _, a := range dbPayments { + payments = append(payments, convertPayment(a)) + } + + rsp := &pb.ListPaymentsResponse{ + Payments: payments, + } + + return rsp, nil +} + +func validateListPaymentsRequest(req *pb.ListPaymentsRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetAccountId() < 1 { + violations = append(violations, fieldViolation("account_id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/gapi/rpc_list_sessions.go b/bff/gapi/rpc_list_sessions.go index be6af06..4b2d8a8 100644 --- a/bff/gapi/rpc_list_sessions.go +++ b/bff/gapi/rpc_list_sessions.go @@ -6,7 +6,6 @@ import ( "errors" "github.com/itsscb/df/bff/pb" - "github.com/itsscb/df/bff/val" "google.golang.org/genproto/googleapis/rpc/errdetails" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -23,18 +22,33 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ return nil, invalidArgumentError(violations) } - dbSessions, err := server.store.ListSessions(ctx, req.GetEmail()) + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + if account.ID != req.GetAccountId() { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + dbSessions, err := server.store.ListSessions(ctx, account.Email) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no accounts found") } return nil, status.Error(codes.NotFound, "failed to get accounts") } - if authPayload.Email != req.GetEmail() { - if !server.isAdmin(ctx, authPayload) { - return nil, status.Error(codes.PermissionDenied, "only for administrators") - } - } var sessions []*pb.Session for _, s := range dbSessions { @@ -42,15 +56,15 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ } rsp := &pb.ListSessionsResponse{ - Session: sessions, + Sessions: sessions, } return rsp, nil } func validateListSessionsRequest(req *pb.ListSessionsRequest) (violations []*errdetails.BadRequest_FieldViolation) { - if err := val.ValidateEmail(req.GetEmail()); err != nil { - violations = append(violations, fieldViolation("email", err)) + if req.GetAccountId() < 1 { + violations = append(violations, fieldViolation("account_id", errors.New("must be greater than 0"))) } return violations diff --git a/bff/gapi/rpc_update_payment.go b/bff/gapi/rpc_update_payment.go new file mode 100644 index 0000000..3856389 --- /dev/null +++ b/bff/gapi/rpc_update_payment.go @@ -0,0 +1,116 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + db "github.com/itsscb/df/bff/db/sqlc" + "github.com/itsscb/df/bff/pb" + "github.com/itsscb/df/bff/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRequest) (*pb.UpdatePaymentResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateUpdatePaymentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + dbPayment, err := server.store.GetPayment(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "payment not found") + } + return nil, status.Error(codes.Internal, "failed to get payment") + } + + if dbPayment.AccountID != account.ID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "payment not found") + } + } + + arg := db.UpdatePaymentParams{ + ID: req.GetId(), + PaymentCategory: sql.NullString{ + Valid: req.GetPaymentCategory() != "", + String: req.GetPaymentCategory(), + }, + Bankname: sql.NullString{ + Valid: req.GetBankname() != "", + String: req.GetBankname(), + }, + Iban: sql.NullString{ + Valid: req.GetIBAN() != "", + String: req.GetIBAN(), + }, + Bic: sql.NullString{ + Valid: req.GetBIC() != "", + String: req.GetBIC(), + }, + PaypalAccount: sql.NullString{ + Valid: req.GetPaypalAccount() != "", + String: req.GetPaypalAccount(), + }, + PaypalID: sql.NullString{ + Valid: req.GetPaypalId() != "", + String: req.GetPaypalId(), + }, + PaymentSystem: sql.NullString{ + Valid: req.GetPaymentSystem() != "", + String: req.GetPaymentSystem(), + }, + Type: sql.NullString{ + Valid: req.GetType() != "", + String: req.GetType(), + }, + Changer: authPayload.Email, + } + + payment, err := server.store.UpdatePayment(ctx, arg) + if err != nil { + return nil, status.Error(codes.Internal, "failed to update payment") + } + + rsp := &pb.UpdatePaymentResponse{ + Payment: convertPayment(payment), + } + + return rsp, nil +} + +func validateUpdatePaymentRequest(req *pb.UpdatePaymentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + if req.GetPaypalAccount() != "" { + if err := val.ValidateEmail(req.GetPaypalAccount()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + } + + return violations +} diff --git a/bff/pb/payment.pb.go b/bff/pb/payment.pb.go new file mode 100644 index 0000000..481beee --- /dev/null +++ b/bff/pb/payment.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: payment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Payment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AccountId int64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + PaymentCategory string `protobuf:"bytes,3,opt,name=payment_category,json=paymentCategory,proto3" json:"payment_category,omitempty"` + Bankname *string `protobuf:"bytes,4,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` + IBAN *string `protobuf:"bytes,5,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` + BIC *string `protobuf:"bytes,6,opt,name=BIC,proto3,oneof" json:"BIC,omitempty"` + PaypalAccount *string `protobuf:"bytes,7,opt,name=paypal_account,json=paypalAccount,proto3,oneof" json:"paypal_account,omitempty"` + PaypalId *string `protobuf:"bytes,8,opt,name=paypal_id,json=paypalId,proto3,oneof" json:"paypal_id,omitempty"` + PaymentSystem *string `protobuf:"bytes,9,opt,name=payment_system,json=paymentSystem,proto3,oneof" json:"payment_system,omitempty"` + Type string `protobuf:"bytes,10,opt,name=type,proto3" json:"type,omitempty"` + Creator string `protobuf:"bytes,11,opt,name=creator,proto3" json:"creator,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=created,proto3" json:"created,omitempty"` + Changer string `protobuf:"bytes,13,opt,name=changer,proto3" json:"changer,omitempty"` + Changed *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=changed,proto3" json:"changed,omitempty"` +} + +func (x *Payment) Reset() { + *x = Payment{} + if protoimpl.UnsafeEnabled { + mi := &file_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payment) ProtoMessage() {} + +func (x *Payment) ProtoReflect() protoreflect.Message { + mi := &file_payment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payment.ProtoReflect.Descriptor instead. +func (*Payment) Descriptor() ([]byte, []int) { + return file_payment_proto_rawDescGZIP(), []int{0} +} + +func (x *Payment) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Payment) GetAccountId() int64 { + if x != nil { + return x.AccountId + } + return 0 +} + +func (x *Payment) GetPaymentCategory() string { + if x != nil { + return x.PaymentCategory + } + return "" +} + +func (x *Payment) GetBankname() string { + if x != nil && x.Bankname != nil { + return *x.Bankname + } + return "" +} + +func (x *Payment) GetIBAN() string { + if x != nil && x.IBAN != nil { + return *x.IBAN + } + return "" +} + +func (x *Payment) GetBIC() string { + if x != nil && x.BIC != nil { + return *x.BIC + } + return "" +} + +func (x *Payment) GetPaypalAccount() string { + if x != nil && x.PaypalAccount != nil { + return *x.PaypalAccount + } + return "" +} + +func (x *Payment) GetPaypalId() string { + if x != nil && x.PaypalId != nil { + return *x.PaypalId + } + return "" +} + +func (x *Payment) GetPaymentSystem() string { + if x != nil && x.PaymentSystem != nil { + return *x.PaymentSystem + } + return "" +} + +func (x *Payment) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Payment) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Payment) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *Payment) GetChanger() string { + if x != nil { + return x.Changer + } + return "" +} + +func (x *Payment) GetChanged() *timestamppb.Timestamp { + if x != nil { + return x.Changed + } + return nil +} + +var File_payment_proto protoreflect.FileDescriptor + +var file_payment_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x07, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x08, 0x62, 0x61, + 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x49, + 0x42, 0x41, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x49, 0x42, 0x41, + 0x4e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x42, 0x49, 0x43, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x03, 0x42, 0x49, 0x43, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, + 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x79, 0x70, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x70, 0x61, + 0x79, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x51, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, + 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x07, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, + 0x12, 0x51, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, + 0x41, 0x18, 0x4a, 0x16, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, + 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x64, 0x3a, 0xee, 0x02, 0x92, 0x41, 0xea, 0x02, 0x0a, 0x09, 0x2a, 0x07, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0xdc, 0x02, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, + 0x31, 0x22, 0x2c, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, 0x20, + 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, + 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, + 0x22, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x69, 0x73, 0x2d, 0x61, 0x2d, 0x70, 0x61, 0x79, 0x70, 0x61, + 0x6c, 0x2d, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, 0x20, 0x70, + 0x61, 0x79, 0x70, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, 0x20, 0x73, 0x6f, 0x6d, + 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, + 0x30, 0x35, 0x54, 0x30, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x35, 0x33, 0x5a, 0x22, 0x2c, 0x20, 0x22, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, + 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, + 0x2c, 0x20, 0x22, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, + 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x35, + 0x33, 0x5a, 0x22, 0x7d, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, + 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x49, 0x42, 0x41, 0x4e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x42, + 0x49, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_payment_proto_rawDescOnce sync.Once + file_payment_proto_rawDescData = file_payment_proto_rawDesc +) + +func file_payment_proto_rawDescGZIP() []byte { + file_payment_proto_rawDescOnce.Do(func() { + file_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_payment_proto_rawDescData) + }) + return file_payment_proto_rawDescData +} + +var file_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_payment_proto_goTypes = []interface{}{ + (*Payment)(nil), // 0: pb.Payment + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_payment_proto_depIdxs = []int32{ + 1, // 0: pb.Payment.created:type_name -> google.protobuf.Timestamp + 1, // 1: pb.Payment.changed:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_payment_proto_init() } +func file_payment_proto_init() { + if File_payment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_payment_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_payment_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_payment_proto_goTypes, + DependencyIndexes: file_payment_proto_depIdxs, + MessageInfos: file_payment_proto_msgTypes, + }.Build() + File_payment_proto = out.File + file_payment_proto_rawDesc = nil + file_payment_proto_goTypes = nil + file_payment_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_create_payment.pb.go b/bff/pb/rpc_create_payment.pb.go new file mode 100644 index 0000000..7ce5d6f --- /dev/null +++ b/bff/pb/rpc_create_payment.pb.go @@ -0,0 +1,325 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_create_payment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreatePaymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + PaymentCategory string `protobuf:"bytes,2,opt,name=payment_category,json=paymentCategory,proto3" json:"payment_category,omitempty"` + Bankname *string `protobuf:"bytes,3,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` + IBAN *string `protobuf:"bytes,4,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` + BIC *string `protobuf:"bytes,5,opt,name=BIC,proto3,oneof" json:"BIC,omitempty"` + PaypalAccount *string `protobuf:"bytes,6,opt,name=paypal_account,json=paypalAccount,proto3,oneof" json:"paypal_account,omitempty"` + PaypalId *string `protobuf:"bytes,7,opt,name=paypal_id,json=paypalId,proto3,oneof" json:"paypal_id,omitempty"` + PaymentSystem *string `protobuf:"bytes,8,opt,name=payment_system,json=paymentSystem,proto3,oneof" json:"payment_system,omitempty"` + Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *CreatePaymentRequest) Reset() { + *x = CreatePaymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_create_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePaymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePaymentRequest) ProtoMessage() {} + +func (x *CreatePaymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_create_payment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePaymentRequest.ProtoReflect.Descriptor instead. +func (*CreatePaymentRequest) Descriptor() ([]byte, []int) { + return file_rpc_create_payment_proto_rawDescGZIP(), []int{0} +} + +func (x *CreatePaymentRequest) GetAccountId() int64 { + if x != nil { + return x.AccountId + } + return 0 +} + +func (x *CreatePaymentRequest) GetPaymentCategory() string { + if x != nil { + return x.PaymentCategory + } + return "" +} + +func (x *CreatePaymentRequest) GetBankname() string { + if x != nil && x.Bankname != nil { + return *x.Bankname + } + return "" +} + +func (x *CreatePaymentRequest) GetIBAN() string { + if x != nil && x.IBAN != nil { + return *x.IBAN + } + return "" +} + +func (x *CreatePaymentRequest) GetBIC() string { + if x != nil && x.BIC != nil { + return *x.BIC + } + return "" +} + +func (x *CreatePaymentRequest) GetPaypalAccount() string { + if x != nil && x.PaypalAccount != nil { + return *x.PaypalAccount + } + return "" +} + +func (x *CreatePaymentRequest) GetPaypalId() string { + if x != nil && x.PaypalId != nil { + return *x.PaypalId + } + return "" +} + +func (x *CreatePaymentRequest) GetPaymentSystem() string { + if x != nil && x.PaymentSystem != nil { + return *x.PaymentSystem + } + return "" +} + +func (x *CreatePaymentRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type CreatePaymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payment *Payment `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` +} + +func (x *CreatePaymentResponse) Reset() { + *x = CreatePaymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_create_payment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePaymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePaymentResponse) ProtoMessage() {} + +func (x *CreatePaymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_create_payment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePaymentResponse.ProtoReflect.Descriptor instead. +func (*CreatePaymentResponse) Descriptor() ([]byte, []int) { + return file_rpc_create_payment_proto_rawDescGZIP(), []int{1} +} + +func (x *CreatePaymentResponse) GetPayment() *Payment { + if x != nil { + return x.Payment + } + return nil +} + +var File_rpc_create_payment_proto protoreflect.FileDescriptor + +var file_rpc_create_payment_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x05, + 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x12, 0x1f, 0x0a, 0x08, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x17, 0x0a, 0x04, 0x49, 0x42, 0x41, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x04, 0x49, 0x42, 0x41, 0x4e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x42, 0x49, + 0x43, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x03, 0x42, 0x49, 0x43, 0x88, 0x01, + 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0d, 0x70, 0x61, 0x79, + 0x70, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, + 0x09, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x04, 0x52, 0x08, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x2a, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a, + 0xaa, 0x02, 0x92, 0x41, 0xa6, 0x02, 0x0a, 0x5b, 0x2a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x20, 0x61, 0x6e, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x0a, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x0e, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0xd2, 0x01, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x32, 0xc6, 0x01, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x54, + 0x42, 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, + 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, + 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x69, 0x73, 0x2d, 0x61, 0x2d, 0x70, + 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2d, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, + 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x22, 0x2c, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, + 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7d, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x49, 0x42, + 0x41, 0x4e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x42, 0x49, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, + 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x78, + 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x1b, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, + 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_create_payment_proto_rawDescOnce sync.Once + file_rpc_create_payment_proto_rawDescData = file_rpc_create_payment_proto_rawDesc +) + +func file_rpc_create_payment_proto_rawDescGZIP() []byte { + file_rpc_create_payment_proto_rawDescOnce.Do(func() { + file_rpc_create_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_create_payment_proto_rawDescData) + }) + return file_rpc_create_payment_proto_rawDescData +} + +var file_rpc_create_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_create_payment_proto_goTypes = []interface{}{ + (*CreatePaymentRequest)(nil), // 0: pb.CreatePaymentRequest + (*CreatePaymentResponse)(nil), // 1: pb.CreatePaymentResponse + (*Payment)(nil), // 2: pb.Payment +} +var file_rpc_create_payment_proto_depIdxs = []int32{ + 2, // 0: pb.CreatePaymentResponse.payment:type_name -> pb.Payment + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_create_payment_proto_init() } +func file_rpc_create_payment_proto_init() { + if File_rpc_create_payment_proto != nil { + return + } + file_payment_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_create_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePaymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_create_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePaymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_rpc_create_payment_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_create_payment_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_create_payment_proto_goTypes, + DependencyIndexes: file_rpc_create_payment_proto_depIdxs, + MessageInfos: file_rpc_create_payment_proto_msgTypes, + }.Build() + File_rpc_create_payment_proto = out.File + file_rpc_create_payment_proto_rawDesc = nil + file_rpc_create_payment_proto_goTypes = nil + file_rpc_create_payment_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_list_accounts.pb.go b/bff/pb/rpc_list_accounts.pb.go index 6b7d6a5..39982d7 100644 --- a/bff/pb/rpc_list_accounts.pb.go +++ b/bff/pb/rpc_list_accounts.pb.go @@ -81,7 +81,7 @@ type ListAccountsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Account []*Account `protobuf:"bytes,1,rep,name=account,proto3" json:"account,omitempty"` + Accounts []*Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } func (x *ListAccountsResponse) Reset() { @@ -116,9 +116,9 @@ func (*ListAccountsResponse) Descriptor() ([]byte, []int) { return file_rpc_list_accounts_proto_rawDescGZIP(), []int{1} } -func (x *ListAccountsResponse) GetAccount() []*Account { +func (x *ListAccountsResponse) GetAccounts() []*Account { if x != nil { - return x.Account + return x.Accounts } return nil } @@ -142,16 +142,16 @@ var file_rpc_list_accounts_proto_rawDesc = []byte{ 0x6f, 0x66, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x20, 0x7b, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x20, 0x31, 0x30, - 0x20, 0x7d, 0x22, 0x75, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, 0x15, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, - 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, + 0x62, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x08, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, + 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, + 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -173,7 +173,7 @@ var file_rpc_list_accounts_proto_goTypes = []interface{}{ (*Account)(nil), // 2: pb.Account } var file_rpc_list_accounts_proto_depIdxs = []int32{ - 2, // 0: pb.ListAccountsResponse.account:type_name -> pb.Account + 2, // 0: pb.ListAccountsResponse.accounts:type_name -> pb.Account 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/bff/pb/rpc_list_payments.pb.go b/bff/pb/rpc_list_payments.pb.go new file mode 100644 index 0000000..5dec19c --- /dev/null +++ b/bff/pb/rpc_list_payments.pb.go @@ -0,0 +1,224 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_list_payments.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListPaymentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *ListPaymentsRequest) Reset() { + *x = ListPaymentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_payments_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPaymentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPaymentsRequest) ProtoMessage() {} + +func (x *ListPaymentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_payments_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPaymentsRequest.ProtoReflect.Descriptor instead. +func (*ListPaymentsRequest) Descriptor() ([]byte, []int) { + return file_rpc_list_payments_proto_rawDescGZIP(), []int{0} +} + +func (x *ListPaymentsRequest) GetAccountId() int64 { + if x != nil { + return x.AccountId + } + return 0 +} + +type ListPaymentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payments []*Payment `protobuf:"bytes,1,rep,name=payments,proto3" json:"payments,omitempty"` +} + +func (x *ListPaymentsResponse) Reset() { + *x = ListPaymentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_payments_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPaymentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPaymentsResponse) ProtoMessage() {} + +func (x *ListPaymentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_payments_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPaymentsResponse.ProtoReflect.Descriptor instead. +func (*ListPaymentsResponse) Descriptor() ([]byte, []int) { + return file_rpc_list_payments_proto_rawDescGZIP(), []int{1} +} + +func (x *ListPaymentsResponse) GetPayments() []*Payment { + if x != nil { + return x.Payments + } + return nil +} + +var File_rpc_list_payments_proto protoreflect.FileDescriptor + +var file_rpc_list_payments_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x13, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x64, 0x3a, 0x48, 0x92, 0x41, 0x45, 0x0a, 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x12, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_list_payments_proto_rawDescOnce sync.Once + file_rpc_list_payments_proto_rawDescData = file_rpc_list_payments_proto_rawDesc +) + +func file_rpc_list_payments_proto_rawDescGZIP() []byte { + file_rpc_list_payments_proto_rawDescOnce.Do(func() { + file_rpc_list_payments_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_list_payments_proto_rawDescData) + }) + return file_rpc_list_payments_proto_rawDescData +} + +var file_rpc_list_payments_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_list_payments_proto_goTypes = []interface{}{ + (*ListPaymentsRequest)(nil), // 0: pb.ListPaymentsRequest + (*ListPaymentsResponse)(nil), // 1: pb.ListPaymentsResponse + (*Payment)(nil), // 2: pb.Payment +} +var file_rpc_list_payments_proto_depIdxs = []int32{ + 2, // 0: pb.ListPaymentsResponse.payments:type_name -> pb.Payment + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_list_payments_proto_init() } +func file_rpc_list_payments_proto_init() { + if File_rpc_list_payments_proto != nil { + return + } + file_payment_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_list_payments_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPaymentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_list_payments_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPaymentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_list_payments_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_list_payments_proto_goTypes, + DependencyIndexes: file_rpc_list_payments_proto_depIdxs, + MessageInfos: file_rpc_list_payments_proto_msgTypes, + }.Build() + File_rpc_list_payments_proto = out.File + file_rpc_list_payments_proto_rawDesc = nil + file_rpc_list_payments_proto_goTypes = nil + file_rpc_list_payments_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_list_sessions.pb.go b/bff/pb/rpc_list_sessions.pb.go index b8001c4..6be8491 100644 --- a/bff/pb/rpc_list_sessions.pb.go +++ b/bff/pb/rpc_list_sessions.pb.go @@ -26,7 +26,7 @@ type ListSessionsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *ListSessionsRequest) Reset() { @@ -61,11 +61,11 @@ func (*ListSessionsRequest) Descriptor() ([]byte, []int) { return file_rpc_list_sessions_proto_rawDescGZIP(), []int{0} } -func (x *ListSessionsRequest) GetEmail() string { +func (x *ListSessionsRequest) GetAccountId() int64 { if x != nil { - return x.Email + return x.AccountId } - return "" + return 0 } type ListSessionsResponse struct { @@ -73,7 +73,7 @@ type ListSessionsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Session []*Session `protobuf:"bytes,1,rep,name=session,proto3" json:"session,omitempty"` + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` } func (x *ListSessionsResponse) Reset() { @@ -108,9 +108,9 @@ func (*ListSessionsResponse) Descriptor() ([]byte, []int) { return file_rpc_list_sessions_proto_rawDescGZIP(), []int{1} } -func (x *ListSessionsResponse) GetSession() []*Session { +func (x *ListSessionsResponse) GetSessions() []*Session { if x != nil { - return x.Session + return x.Sessions } return nil } @@ -123,26 +123,27 @@ var file_rpc_list_sessions_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x01, 0x0a, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x5b, 0x92, 0x41, 0x58, 0x0a, - 0x32, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, - 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, - 0x6f, 0x66, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x32, 0x22, 0x7b, 0x22, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x3a, 0x20, 0x22, - 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x20, 0x7d, 0x22, 0x76, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, + 0xa2, 0x02, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x64, 0x3a, 0x52, 0x92, 0x41, 0x4f, 0x0a, 0x37, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x32, 0x14, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, + 0x3a, 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x22, 0x78, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0x92, - 0x41, 0x00, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x32, 0x92, 0x41, 0x2f, - 0x0a, 0x2d, 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x14, 0x52, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, - 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, - 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x03, + 0x92, 0x41, 0x00, 0x52, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x32, 0x92, + 0x41, 0x2f, 0x0a, 0x2d, 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x14, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -164,7 +165,7 @@ var file_rpc_list_sessions_proto_goTypes = []interface{}{ (*Session)(nil), // 2: pb.Session } var file_rpc_list_sessions_proto_depIdxs = []int32{ - 2, // 0: pb.ListSessionsResponse.session:type_name -> pb.Session + 2, // 0: pb.ListSessionsResponse.sessions:type_name -> pb.Session 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/bff/pb/rpc_update_payment.pb.go b/bff/pb/rpc_update_payment.pb.go new file mode 100644 index 0000000..d8480e7 --- /dev/null +++ b/bff/pb/rpc_update_payment.pb.go @@ -0,0 +1,323 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_update_payment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UpdatePaymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PaymentCategory *string `protobuf:"bytes,2,opt,name=payment_category,json=paymentCategory,proto3,oneof" json:"payment_category,omitempty"` + Bankname *string `protobuf:"bytes,3,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` + IBAN *string `protobuf:"bytes,4,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` + BIC *string `protobuf:"bytes,5,opt,name=BIC,proto3,oneof" json:"BIC,omitempty"` + PaypalAccount *string `protobuf:"bytes,6,opt,name=paypal_account,json=paypalAccount,proto3,oneof" json:"paypal_account,omitempty"` + PaypalId *string `protobuf:"bytes,7,opt,name=paypal_id,json=paypalId,proto3,oneof" json:"paypal_id,omitempty"` + PaymentSystem *string `protobuf:"bytes,8,opt,name=payment_system,json=paymentSystem,proto3,oneof" json:"payment_system,omitempty"` + Type *string `protobuf:"bytes,9,opt,name=type,proto3,oneof" json:"type,omitempty"` +} + +func (x *UpdatePaymentRequest) Reset() { + *x = UpdatePaymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_update_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePaymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePaymentRequest) ProtoMessage() {} + +func (x *UpdatePaymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_update_payment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePaymentRequest.ProtoReflect.Descriptor instead. +func (*UpdatePaymentRequest) Descriptor() ([]byte, []int) { + return file_rpc_update_payment_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdatePaymentRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdatePaymentRequest) GetPaymentCategory() string { + if x != nil && x.PaymentCategory != nil { + return *x.PaymentCategory + } + return "" +} + +func (x *UpdatePaymentRequest) GetBankname() string { + if x != nil && x.Bankname != nil { + return *x.Bankname + } + return "" +} + +func (x *UpdatePaymentRequest) GetIBAN() string { + if x != nil && x.IBAN != nil { + return *x.IBAN + } + return "" +} + +func (x *UpdatePaymentRequest) GetBIC() string { + if x != nil && x.BIC != nil { + return *x.BIC + } + return "" +} + +func (x *UpdatePaymentRequest) GetPaypalAccount() string { + if x != nil && x.PaypalAccount != nil { + return *x.PaypalAccount + } + return "" +} + +func (x *UpdatePaymentRequest) GetPaypalId() string { + if x != nil && x.PaypalId != nil { + return *x.PaypalId + } + return "" +} + +func (x *UpdatePaymentRequest) GetPaymentSystem() string { + if x != nil && x.PaymentSystem != nil { + return *x.PaymentSystem + } + return "" +} + +func (x *UpdatePaymentRequest) GetType() string { + if x != nil && x.Type != nil { + return *x.Type + } + return "" +} + +type UpdatePaymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payment *Payment `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` +} + +func (x *UpdatePaymentResponse) Reset() { + *x = UpdatePaymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_update_payment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePaymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePaymentResponse) ProtoMessage() {} + +func (x *UpdatePaymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_update_payment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePaymentResponse.ProtoReflect.Descriptor instead. +func (*UpdatePaymentResponse) Descriptor() ([]byte, []int) { + return file_rpc_update_payment_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdatePaymentResponse) GetPayment() *Payment { + if x != nil { + return x.Payment + } + return nil +} + +var File_rpc_update_payment_proto protoreflect.FileDescriptor + +var file_rpc_update_payment_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x05, + 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x62, 0x61, 0x6e, 0x6b, + 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x49, 0x42, 0x41, 0x4e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x04, 0x49, 0x42, 0x41, 0x4e, 0x88, 0x01, 0x01, + 0x12, 0x15, 0x0a, 0x03, 0x42, 0x49, 0x43, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, + 0x03, 0x42, 0x49, 0x43, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x70, 0x61, + 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x08, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, + 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, + 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x88, 0x01, + 0x01, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x07, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x3a, 0xef, 0x01, 0x92, 0x41, 0xeb, + 0x01, 0x0a, 0x28, 0x2a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x32, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0xbe, 0x01, 0x7b, 0x22, + 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x54, + 0x42, 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, + 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, + 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x69, 0x73, 0x2d, 0x61, 0x2d, 0x70, + 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2d, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, + 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x22, 0x2c, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, + 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7d, 0x42, 0x13, 0x0a, 0x11, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, + 0x0a, 0x05, 0x5f, 0x49, 0x42, 0x41, 0x4e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x42, 0x49, 0x43, 0x42, + 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x78, 0x0a, 0x15, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x1b, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_update_payment_proto_rawDescOnce sync.Once + file_rpc_update_payment_proto_rawDescData = file_rpc_update_payment_proto_rawDesc +) + +func file_rpc_update_payment_proto_rawDescGZIP() []byte { + file_rpc_update_payment_proto_rawDescOnce.Do(func() { + file_rpc_update_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_update_payment_proto_rawDescData) + }) + return file_rpc_update_payment_proto_rawDescData +} + +var file_rpc_update_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_update_payment_proto_goTypes = []interface{}{ + (*UpdatePaymentRequest)(nil), // 0: pb.UpdatePaymentRequest + (*UpdatePaymentResponse)(nil), // 1: pb.UpdatePaymentResponse + (*Payment)(nil), // 2: pb.Payment +} +var file_rpc_update_payment_proto_depIdxs = []int32{ + 2, // 0: pb.UpdatePaymentResponse.payment:type_name -> pb.Payment + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_update_payment_proto_init() } +func file_rpc_update_payment_proto_init() { + if File_rpc_update_payment_proto != nil { + return + } + file_payment_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_update_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePaymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_update_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePaymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_rpc_update_payment_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_update_payment_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_update_payment_proto_goTypes, + DependencyIndexes: file_rpc_update_payment_proto_depIdxs, + MessageInfos: file_rpc_update_payment_proto_msgTypes, + }.Build() + File_rpc_update_payment_proto = out.File + file_rpc_update_payment_proto_rawDesc = nil + file_rpc_update_payment_proto_goTypes = nil + file_rpc_update_payment_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index b0934ae..fd949a3 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -33,89 +33,124 @@ var file_service_df_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, - 0xe6, 0x08, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, - 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, - 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x5f, 0x0a, 0x0c, 0x52, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x74, 0x0a, 0x0c, 0x42, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, + 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, + 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xc9, 0x0c, 0x0a, + 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, + 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x32, 0x11, - 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x69, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x71, 0x0a, 0x0c, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2e, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, - 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x71, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x7a, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, + 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, + 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, + 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, + 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, - 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x12, 0x63, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x78, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x32, 0x12, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x95, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, - 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x74, 0x0a, 0x0c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x92, 0x41, - 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x1a, + 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, + 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, @@ -134,48 +169,60 @@ var file_service_df_proto_rawDesc = []byte{ var file_service_df_proto_goTypes = []interface{}{ (*LoginRequest)(nil), // 0: pb.LoginRequest (*RefreshTokenRequest)(nil), // 1: pb.RefreshTokenRequest - (*BlockSessionRequest)(nil), // 2: pb.BlockSessionRequest - (*GetAccountRequest)(nil), // 3: pb.GetAccountRequest - (*ListSessionsRequest)(nil), // 4: pb.ListSessionsRequest + (*ListSessionsRequest)(nil), // 2: pb.ListSessionsRequest + (*BlockSessionRequest)(nil), // 3: pb.BlockSessionRequest + (*GetAccountRequest)(nil), // 4: pb.GetAccountRequest (*ListAccountsRequest)(nil), // 5: pb.ListAccountsRequest (*CreateAccountRequest)(nil), // 6: pb.CreateAccountRequest (*UpdateAccountRequest)(nil), // 7: pb.UpdateAccountRequest (*UpdateAccountPrivacyRequest)(nil), // 8: pb.UpdateAccountPrivacyRequest (*CreatePersonRequest)(nil), // 9: pb.CreatePersonRequest - (*LoginResponse)(nil), // 10: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 11: pb.RefreshTokenResponse - (*BlockSessionResponse)(nil), // 12: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 13: pb.GetAccountResponse - (*ListSessionsResponse)(nil), // 14: pb.ListSessionsResponse - (*ListAccountsResponse)(nil), // 15: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 16: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 17: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 18: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 19: pb.CreatePersonResponse + (*CreatePaymentRequest)(nil), // 10: pb.CreatePaymentRequest + (*ListPaymentsRequest)(nil), // 11: pb.ListPaymentsRequest + (*UpdatePaymentRequest)(nil), // 12: pb.UpdatePaymentRequest + (*LoginResponse)(nil), // 13: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 14: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 15: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 16: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 17: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 18: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 19: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 20: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 21: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 22: pb.CreatePersonResponse + (*CreatePaymentResponse)(nil), // 23: pb.CreatePaymentResponse + (*ListPaymentsResponse)(nil), // 24: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 25: pb.UpdatePaymentResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest 1, // 1: pb.df.RefreshToken:input_type -> pb.RefreshTokenRequest - 2, // 2: pb.df.BlockSession:input_type -> pb.BlockSessionRequest - 3, // 3: pb.df.GetAccount:input_type -> pb.GetAccountRequest - 4, // 4: pb.df.ListSessions:input_type -> pb.ListSessionsRequest + 2, // 2: pb.df.ListSessions:input_type -> pb.ListSessionsRequest + 3, // 3: pb.df.BlockSession:input_type -> pb.BlockSessionRequest + 4, // 4: pb.df.GetAccount:input_type -> pb.GetAccountRequest 5, // 5: pb.df.ListAccounts:input_type -> pb.ListAccountsRequest 6, // 6: pb.df.CreateAccount:input_type -> pb.CreateAccountRequest 7, // 7: pb.df.UpdateAccount:input_type -> pb.UpdateAccountRequest 8, // 8: pb.df.UpdateAccountPrivacy:input_type -> pb.UpdateAccountPrivacyRequest 9, // 9: pb.df.CreatePerson:input_type -> pb.CreatePersonRequest - 10, // 10: pb.df.Login:output_type -> pb.LoginResponse - 11, // 11: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 12, // 12: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 13, // 13: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 14, // 14: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 15, // 15: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 16, // 16: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 17, // 17: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 18, // 18: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 19, // 19: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 10, // [10:20] is the sub-list for method output_type - 0, // [0:10] is the sub-list for method input_type + 10, // 10: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest + 11, // 11: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest + 12, // 12: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest + 13, // 13: pb.df.Login:output_type -> pb.LoginResponse + 14, // 14: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 15, // 15: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 16, // 16: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 17, // 17: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 18, // 18: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 19, // 19: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 20, // 20: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 21, // 21: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 22, // 22: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 23, // 23: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 24, // 24: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 25, // 25: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 13, // [13:26] is the sub-list for method output_type + 0, // [0:13] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -188,9 +235,12 @@ func file_service_df_proto_init() { } file_rpc_create_account_proto_init() file_rpc_create_person_proto_init() + file_rpc_create_payment_proto_init() file_rpc_update_account_proto_init() + file_rpc_update_payment_proto_init() file_rpc_get_account_proto_init() file_rpc_list_accounts_proto_init() + file_rpc_list_payments_proto_init() file_rpc_list_sessions_proto_init() file_rpc_block_session_proto_init() file_rpc_update_account_privacy_proto_init() diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 81092d0..2ec53aa 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -99,6 +99,58 @@ func local_request_Df_RefreshToken_0(ctx context.Context, marshaler runtime.Mars } +func request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListSessionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") + } + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) + } + + msg, err := client.ListSessions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListSessionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") + } + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) + } + + msg, err := server.ListSessions(ctx, &protoReq) + return msg, metadata, err + +} + func request_Df_BlockSession_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq BlockSessionRequest var metadata runtime.ServerMetadata @@ -169,42 +221,6 @@ func local_request_Df_GetAccount_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Df_ListSessions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListSessionsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListSessions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListSessions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListSessionsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListSessions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListSessions(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Df_ListAccounts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -377,6 +393,110 @@ func local_request_Df_CreatePerson_0(ctx context.Context, marshaler runtime.Mars } +func request_Df_CreatePayment_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreatePaymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreatePayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_CreatePayment_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreatePaymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreatePayment(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Df_ListPayments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPaymentsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListPayments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPaymentsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListPayments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListPayments(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Df_UpdatePayment_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePaymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdatePayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_UpdatePayment_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePaymentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdatePayment(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDfHandlerServer registers the http handlers for service Df to "mux". // UnaryRPC :call DfServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -416,7 +536,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/RefreshToken", runtime.WithHTTPPathPattern("/v1/refresh_token")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/RefreshToken", runtime.WithHTTPPathPattern("/v1/sessions/refresh_token")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -433,6 +553,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("GET", pattern_Df_ListSessions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListSessions", runtime.WithHTTPPathPattern("/v1/sessions/list_sessions/{account_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_ListSessions_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListSessions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("PATCH", pattern_Df_BlockSession_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -441,7 +586,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/BlockSession", runtime.WithHTTPPathPattern("/v1/block_session")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/BlockSession", runtime.WithHTTPPathPattern("/v1/sessions/block_session")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -466,7 +611,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/get_account")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -483,31 +628,6 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) - mux.Handle("GET", pattern_Df_ListSessions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListSessions", runtime.WithHTTPPathPattern("/v1/list_sessions")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Df_ListSessions_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Df_ListSessions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Df_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -516,7 +636,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListAccounts", runtime.WithHTTPPathPattern("/v1/list_accounts")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListAccounts", runtime.WithHTTPPathPattern("/v1/accounts/list_accounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -541,7 +661,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/CreateAccount", runtime.WithHTTPPathPattern("/v1/create_account")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/CreateAccount", runtime.WithHTTPPathPattern("/v1/accounts/create_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -566,7 +686,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdateAccount", runtime.WithHTTPPathPattern("/v1/update_account")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdateAccount", runtime.WithHTTPPathPattern("/v1/accounts/update_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -591,7 +711,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdateAccountPrivacy", runtime.WithHTTPPathPattern("/v1/update_account_privacy")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdateAccountPrivacy", runtime.WithHTTPPathPattern("/v1/accounts/update_account_privacy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -616,7 +736,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/CreatePerson", runtime.WithHTTPPathPattern("/v1/create_person")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/CreatePerson", runtime.WithHTTPPathPattern("/v1/persons/create_person")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -633,6 +753,81 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Df_CreatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/CreatePayment", runtime.WithHTTPPathPattern("/v1/payments/create_payment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_CreatePayment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_CreatePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_ListPayments_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListPayments_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_Df_UpdatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdatePayment", runtime.WithHTTPPathPattern("/v1/payments/update_payment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_UpdatePayment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UpdatePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -702,7 +897,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/RefreshToken", runtime.WithHTTPPathPattern("/v1/refresh_token")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/RefreshToken", runtime.WithHTTPPathPattern("/v1/sessions/refresh_token")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -718,13 +913,35 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("GET", pattern_Df_ListSessions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListSessions", runtime.WithHTTPPathPattern("/v1/sessions/list_sessions/{account_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_ListSessions_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListSessions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("PATCH", pattern_Df_BlockSession_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/BlockSession", runtime.WithHTTPPathPattern("/v1/block_session")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/BlockSession", runtime.WithHTTPPathPattern("/v1/sessions/block_session")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -746,7 +963,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/get_account")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -762,35 +979,13 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) - mux.Handle("GET", pattern_Df_ListSessions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListSessions", runtime.WithHTTPPathPattern("/v1/list_sessions")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Df_ListSessions_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Df_ListSessions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Df_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListAccounts", runtime.WithHTTPPathPattern("/v1/list_accounts")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListAccounts", runtime.WithHTTPPathPattern("/v1/accounts/list_accounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -812,7 +1007,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/CreateAccount", runtime.WithHTTPPathPattern("/v1/create_account")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/CreateAccount", runtime.WithHTTPPathPattern("/v1/accounts/create_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -834,7 +1029,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdateAccount", runtime.WithHTTPPathPattern("/v1/update_account")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdateAccount", runtime.WithHTTPPathPattern("/v1/accounts/update_account")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -856,7 +1051,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdateAccountPrivacy", runtime.WithHTTPPathPattern("/v1/update_account_privacy")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdateAccountPrivacy", runtime.WithHTTPPathPattern("/v1/accounts/update_account_privacy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -878,7 +1073,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/CreatePerson", runtime.WithHTTPPathPattern("/v1/create_person")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/CreatePerson", runtime.WithHTTPPathPattern("/v1/persons/create_person")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -894,29 +1089,101 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Df_CreatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/CreatePayment", runtime.WithHTTPPathPattern("/v1/payments/create_payment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_CreatePayment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_CreatePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_ListPayments_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListPayments_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_Df_UpdatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdatePayment", runtime.WithHTTPPathPattern("/v1/payments/update_payment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_UpdatePayment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UpdatePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Df_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "login"}, "")) - pattern_Df_RefreshToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "refresh_token"}, "")) + pattern_Df_RefreshToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sessions", "refresh_token"}, "")) - pattern_Df_BlockSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "block_session"}, "")) + pattern_Df_ListSessions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "sessions", "list_sessions", "account_id"}, "")) - pattern_Df_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_account"}, "")) + pattern_Df_BlockSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sessions", "block_session"}, "")) - pattern_Df_ListSessions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_sessions"}, "")) + pattern_Df_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "get_account"}, "")) - pattern_Df_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_accounts"}, "")) + pattern_Df_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "list_accounts"}, "")) - pattern_Df_CreateAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_account"}, "")) + pattern_Df_CreateAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "create_account"}, "")) - pattern_Df_UpdateAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_account"}, "")) + pattern_Df_UpdateAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "update_account"}, "")) - pattern_Df_UpdateAccountPrivacy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_account_privacy"}, "")) + pattern_Df_UpdateAccountPrivacy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "update_account_privacy"}, "")) - pattern_Df_CreatePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_person"}, "")) + pattern_Df_CreatePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "persons", "create_person"}, "")) + + pattern_Df_CreatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "create_payment"}, "")) + + pattern_Df_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "list_payments"}, "")) + + pattern_Df_UpdatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "update_payment"}, "")) ) var ( @@ -924,12 +1191,12 @@ var ( forward_Df_RefreshToken_0 = runtime.ForwardResponseMessage + forward_Df_ListSessions_0 = runtime.ForwardResponseMessage + forward_Df_BlockSession_0 = runtime.ForwardResponseMessage forward_Df_GetAccount_0 = runtime.ForwardResponseMessage - forward_Df_ListSessions_0 = runtime.ForwardResponseMessage - forward_Df_ListAccounts_0 = runtime.ForwardResponseMessage forward_Df_CreateAccount_0 = runtime.ForwardResponseMessage @@ -939,4 +1206,10 @@ var ( forward_Df_UpdateAccountPrivacy_0 = runtime.ForwardResponseMessage forward_Df_CreatePerson_0 = runtime.ForwardResponseMessage + + forward_Df_CreatePayment_0 = runtime.ForwardResponseMessage + + forward_Df_ListPayments_0 = runtime.ForwardResponseMessage + + forward_Df_UpdatePayment_0 = runtime.ForwardResponseMessage ) diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index 3718c04..b526f09 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -21,14 +21,17 @@ const _ = grpc.SupportPackageIsVersion7 const ( Df_Login_FullMethodName = "/pb.df/Login" Df_RefreshToken_FullMethodName = "/pb.df/RefreshToken" + Df_ListSessions_FullMethodName = "/pb.df/ListSessions" Df_BlockSession_FullMethodName = "/pb.df/BlockSession" Df_GetAccount_FullMethodName = "/pb.df/GetAccount" - Df_ListSessions_FullMethodName = "/pb.df/ListSessions" Df_ListAccounts_FullMethodName = "/pb.df/ListAccounts" Df_CreateAccount_FullMethodName = "/pb.df/CreateAccount" Df_UpdateAccount_FullMethodName = "/pb.df/UpdateAccount" Df_UpdateAccountPrivacy_FullMethodName = "/pb.df/UpdateAccountPrivacy" Df_CreatePerson_FullMethodName = "/pb.df/CreatePerson" + Df_CreatePayment_FullMethodName = "/pb.df/CreatePayment" + Df_ListPayments_FullMethodName = "/pb.df/ListPayments" + Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" ) // DfClient is the client API for Df service. @@ -37,14 +40,17 @@ const ( type DfClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error) + ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) BlockSession(ctx context.Context, in *BlockSessionRequest, opts ...grpc.CallOption) (*BlockSessionResponse, error) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error) - ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*UpdateAccountResponse, error) UpdateAccountPrivacy(ctx context.Context, in *UpdateAccountPrivacyRequest, opts ...grpc.CallOption) (*UpdateAccountPrivacyResponse, error) CreatePerson(ctx context.Context, in *CreatePersonRequest, opts ...grpc.CallOption) (*CreatePersonResponse, error) + CreatePayment(ctx context.Context, in *CreatePaymentRequest, opts ...grpc.CallOption) (*CreatePaymentResponse, error) + ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) + UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) } type dfClient struct { @@ -73,6 +79,15 @@ func (c *dfClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, op return out, nil } +func (c *dfClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) { + out := new(ListSessionsResponse) + err := c.cc.Invoke(ctx, Df_ListSessions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfClient) BlockSession(ctx context.Context, in *BlockSessionRequest, opts ...grpc.CallOption) (*BlockSessionResponse, error) { out := new(BlockSessionResponse) err := c.cc.Invoke(ctx, Df_BlockSession_FullMethodName, in, out, opts...) @@ -91,15 +106,6 @@ func (c *dfClient) GetAccount(ctx context.Context, in *GetAccountRequest, opts . return out, nil } -func (c *dfClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) { - out := new(ListSessionsResponse) - err := c.cc.Invoke(ctx, Df_ListSessions_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *dfClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) { out := new(ListAccountsResponse) err := c.cc.Invoke(ctx, Df_ListAccounts_FullMethodName, in, out, opts...) @@ -145,20 +151,50 @@ func (c *dfClient) CreatePerson(ctx context.Context, in *CreatePersonRequest, op return out, nil } +func (c *dfClient) CreatePayment(ctx context.Context, in *CreatePaymentRequest, opts ...grpc.CallOption) (*CreatePaymentResponse, error) { + out := new(CreatePaymentResponse) + err := c.cc.Invoke(ctx, Df_CreatePayment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dfClient) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) { + out := new(ListPaymentsResponse) + err := c.cc.Invoke(ctx, Df_ListPayments_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dfClient) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) { + out := new(UpdatePaymentResponse) + err := c.cc.Invoke(ctx, Df_UpdatePayment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DfServer is the server API for Df service. // All implementations must embed UnimplementedDfServer // for forward compatibility type DfServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error) + ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) BlockSession(context.Context, *BlockSessionRequest) (*BlockSessionResponse, error) GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error) - ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) UpdateAccount(context.Context, *UpdateAccountRequest) (*UpdateAccountResponse, error) UpdateAccountPrivacy(context.Context, *UpdateAccountPrivacyRequest) (*UpdateAccountPrivacyResponse, error) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) + CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) + ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) + UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) mustEmbedUnimplementedDfServer() } @@ -172,15 +208,15 @@ func (UnimplementedDfServer) Login(context.Context, *LoginRequest) (*LoginRespon func (UnimplementedDfServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") } +func (UnimplementedDfServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSessions not implemented") +} func (UnimplementedDfServer) BlockSession(context.Context, *BlockSessionRequest) (*BlockSessionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BlockSession not implemented") } func (UnimplementedDfServer) GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAccount not implemented") } -func (UnimplementedDfServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSessions not implemented") -} func (UnimplementedDfServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented") } @@ -196,6 +232,15 @@ func (UnimplementedDfServer) UpdateAccountPrivacy(context.Context, *UpdateAccoun func (UnimplementedDfServer) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePerson not implemented") } +func (UnimplementedDfServer) CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePayment not implemented") +} +func (UnimplementedDfServer) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPayments not implemented") +} +func (UnimplementedDfServer) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePayment not implemented") +} func (UnimplementedDfServer) mustEmbedUnimplementedDfServer() {} // UnsafeDfServer may be embedded to opt out of forward compatibility for this service. @@ -245,6 +290,24 @@ func _Df_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Df_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSessionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).ListSessions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_ListSessions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).ListSessions(ctx, req.(*ListSessionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Df_BlockSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BlockSessionRequest) if err := dec(in); err != nil { @@ -281,24 +344,6 @@ func _Df_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Df_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSessionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DfServer).ListSessions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Df_ListSessions_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DfServer).ListSessions(ctx, req.(*ListSessionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Df_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAccountsRequest) if err := dec(in); err != nil { @@ -389,6 +434,60 @@ func _Df_CreatePerson_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Df_CreatePayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePaymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).CreatePayment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_CreatePayment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).CreatePayment(ctx, req.(*CreatePaymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Df_ListPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPaymentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).ListPayments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_ListPayments_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).ListPayments(ctx, req.(*ListPaymentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Df_UpdatePayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePaymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).UpdatePayment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_UpdatePayment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).UpdatePayment(ctx, req.(*UpdatePaymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Df_ServiceDesc is the grpc.ServiceDesc for Df service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -404,6 +503,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "RefreshToken", Handler: _Df_RefreshToken_Handler, }, + { + MethodName: "ListSessions", + Handler: _Df_ListSessions_Handler, + }, { MethodName: "BlockSession", Handler: _Df_BlockSession_Handler, @@ -412,10 +515,6 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetAccount", Handler: _Df_GetAccount_Handler, }, - { - MethodName: "ListSessions", - Handler: _Df_ListSessions_Handler, - }, { MethodName: "ListAccounts", Handler: _Df_ListAccounts_Handler, @@ -436,6 +535,18 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePerson", Handler: _Df_CreatePerson_Handler, }, + { + MethodName: "CreatePayment", + Handler: _Df_CreatePayment_Handler, + }, + { + MethodName: "ListPayments", + Handler: _Df_ListPayments_Handler, + }, + { + MethodName: "UpdatePayment", + Handler: _Df_UpdatePayment_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_df.proto", diff --git a/bff/proto/payment.proto b/bff/proto/payment.proto new file mode 100644 index 0000000..93c16a6 --- /dev/null +++ b/bff/proto/payment.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message Payment { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Payment"; + }; + example: "{\"id\": \"1\",\"account_id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; + }; + int64 id = 1; + int64 account_id = 2; + string payment_category = 3; + optional string bankname = 4; + optional string IBAN = 5; + optional string BIC = 6; + optional string paypal_account = 7; + optional string paypal_id = 8; + optional string payment_system = 9; + string type = 10; + string creator = 11; + google.protobuf.Timestamp created = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; + string changer = 13; + google.protobuf.Timestamp changed = 14 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_create_payment.proto b/bff/proto/rpc_create_payment.proto new file mode 100644 index 0000000..d8149d9 --- /dev/null +++ b/bff/proto/rpc_create_payment.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "payment.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message CreatePaymentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Create Payment"; + description: "Create an Payment"; + required: [ + "account_id", + "payment_category", + "payment_system", + "type" + ]; + }; + example: "{\"account_id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\"}"; + }; + int64 account_id = 1; + string payment_category = 2; + optional string bankname = 3; + optional string IBAN = 4; + optional string BIC = 5; + optional string paypal_account = 6; + optional string paypal_id = 7; + optional string payment_system = 8; + string type = 9; +} + +message CreatePaymentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Created Payment"; + description: "Returns the created Payment"; + }; + }; + Payment payment = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_list_accounts.proto b/bff/proto/rpc_list_accounts.proto index 6a25b54..f972bfa 100644 --- a/bff/proto/rpc_list_accounts.proto +++ b/bff/proto/rpc_list_accounts.proto @@ -30,6 +30,6 @@ message ListAccountsResponse { description: "Returns the Account"; }; }; - repeated Account account = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + repeated Account accounts = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { }]; } \ No newline at end of file diff --git a/bff/proto/rpc_list_payments.proto b/bff/proto/rpc_list_payments.proto new file mode 100644 index 0000000..b994548 --- /dev/null +++ b/bff/proto/rpc_list_payments.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "payment.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message ListPaymentsRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListPayments"; + description: "Returns a List of Payments"; + required: [ + "id" + ]; + }; + example: "{\"account_id\": 1 }"; + }; + int64 account_id = 1; +} + +message ListPaymentsResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListPayments Response"; + description: "Returns the Payment"; + }; + }; + repeated Payment payments = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_list_sessions.proto b/bff/proto/rpc_list_sessions.proto index af61b62..e0a4cdd 100644 --- a/bff/proto/rpc_list_sessions.proto +++ b/bff/proto/rpc_list_sessions.proto @@ -14,12 +14,15 @@ message ListSessionsRequest { title: "ListSessions"; description: "Returns a List of Accounts"; required: [ - "email" + "account_id" ]; }; - example: "{\"email\": \"john.doe@example.com\" }"; + example: "{\"account_id\": \"1\" }"; }; - string email = 1; + int64 account_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "1", + format: "int64" + }]; } message ListSessionsResponse { @@ -29,6 +32,6 @@ message ListSessionsResponse { description: "Returns the Sessions"; }; }; - repeated Session session = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + repeated Session sessions = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { }]; } \ No newline at end of file diff --git a/bff/proto/rpc_update_payment.proto b/bff/proto/rpc_update_payment.proto new file mode 100644 index 0000000..59b911d --- /dev/null +++ b/bff/proto/rpc_update_payment.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "payment.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message UpdatePaymentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Update Payment"; + description: "Update an Payment"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\"}"; + }; + int64 id = 1; + optional string payment_category = 2; + optional string bankname = 3; + optional string IBAN = 4; + optional string BIC = 5; + optional string paypal_account = 6; + optional string paypal_id = 7; + optional string payment_system = 8; + optional string type = 9; +} + +message UpdatePaymentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Updated Payment"; + description: "Returns the updated Payment"; + }; + }; + Payment payment = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index 000c357..d57601f 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -7,9 +7,12 @@ import "protoc-gen-openapiv2/options/annotations.proto"; import "rpc_create_account.proto"; import "rpc_create_person.proto"; +import "rpc_create_payment.proto"; import "rpc_update_account.proto"; +import "rpc_update_payment.proto"; import "rpc_get_account.proto"; import "rpc_list_accounts.proto"; +import "rpc_list_payments.proto"; import "rpc_list_sessions.proto"; import "rpc_block_session.proto"; import "rpc_update_account_privacy.proto"; @@ -58,13 +61,26 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc RefreshToken (RefreshTokenRequest) returns (RefreshTokenResponse) { option (google.api.http) = { - post: "/v1/refresh_token" + post: "/v1/sessions/refresh_token" body: "*" }; }; + rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/sessions/list_sessions/{account_id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; rpc BlockSession (BlockSessionRequest) returns (BlockSessionResponse) { option (google.api.http) = { - patch: "/v1/block_session" + patch: "/v1/sessions/block_session" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -78,7 +94,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc GetAccount (GetAccountRequest) returns (GetAccountResponse) { option (google.api.http) = { - get: "/v1/get_account" + get: "/v1/accounts/get_account" // get: "/v1/accounts/{id=id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -90,23 +106,9 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; - - rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse) { - option (google.api.http) = { - get: "/v1/list_sessions" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - security: { - security_requirement: { - key: "BearerAuth"; - value: {} - } - } - }; - }; rpc ListAccounts (ListAccountsRequest) returns (ListAccountsResponse) { option (google.api.http) = { - get: "/v1/list_accounts" + get: "/v1/accounts/list_accounts" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { @@ -119,13 +121,13 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc CreateAccount (CreateAccountRequest) returns (CreateAccountResponse) { option (google.api.http) = { - post: "/v1/create_account" + post: "/v1/accounts/create_account" body: "*" }; }; rpc UpdateAccount (UpdateAccountRequest) returns (UpdateAccountResponse) { option (google.api.http) = { - patch: "/v1/update_account" + patch: "/v1/accounts/update_account" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -139,7 +141,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc UpdateAccountPrivacy (UpdateAccountPrivacyRequest) returns (UpdateAccountPrivacyResponse) { option (google.api.http) = { - patch: "/v1/update_account_privacy" + patch: "/v1/accounts/update_account_privacy" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -153,7 +155,48 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc CreatePerson (CreatePersonRequest) returns (CreatePersonResponse) { option (google.api.http) = { - post: "/v1/create_person" + post: "/v1/persons/create_person" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse) { + option (google.api.http) = { + post: "/v1/payments/create_payment" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { + option (google.api.http) = { + get: "/v1/payments/list_payments" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc UpdatePayment (UpdatePaymentRequest) returns (UpdatePaymentResponse) { + option (google.api.http) = { + patch: "/v1/payments/update_payment" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { From e4531208e84a5eada312dc7ca2771d202b670e52 Mon Sep 17 00:00:00 2001 From: itsscb Date: Mon, 9 Oct 2023 02:50:09 +0200 Subject: [PATCH 03/15] ft/adds gapi.GetPayment --- bff/doc/swagger/df.swagger.json | 54 ++++- bff/gapi/rpc_get_payment.go | 66 ++++++ bff/pb/rpc_get_payment.pb.go | 222 ++++++++++++++++++++ bff/pb/rpc_list_payments.pb.go | 39 ++-- bff/pb/rpc_update_account.pb.go | 44 ++-- bff/pb/service_df.pb.go | 320 +++++++++++++++-------------- bff/pb/service_df.pb.gw.go | 149 ++++++++++++-- bff/pb/service_df_grpc.pb.go | 37 ++++ bff/proto/rpc_get_payment.proto | 34 +++ bff/proto/rpc_list_payments.proto | 2 +- bff/proto/rpc_update_account.proto | 2 +- bff/proto/service_df.proto | 16 +- 12 files changed, 769 insertions(+), 216 deletions(-) create mode 100644 bff/gapi/rpc_get_payment.go create mode 100644 bff/pb/rpc_get_payment.pb.go create mode 100644 bff/proto/rpc_get_payment.proto diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index d201f12..d49bf24 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -59,7 +59,7 @@ ] } }, - "/v1/accounts/get_account": { + "/v1/accounts/get_account/{id}": { "get": { "operationId": "df_GetAccount", "responses": { @@ -79,7 +79,7 @@ "parameters": [ { "name": "id", - "in": "query", + "in": "path", "required": true, "type": "string", "format": "int64" @@ -285,6 +285,42 @@ ] } }, + "/v1/payments/get_payment/{id}": { + "get": { + "operationId": "df_GetPayment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetPaymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/payments/list_payments": { "get": { "operationId": "df_ListPayments", @@ -306,7 +342,7 @@ { "name": "accountId", "in": "query", - "required": false, + "required": true, "type": "string", "format": "int64" } @@ -836,6 +872,16 @@ "description": "Returns the Account", "title": "GetAccount Response" }, + "pbGetPaymentResponse": { + "type": "object", + "properties": { + "payment": { + "$ref": "#/definitions/pbPayment" + } + }, + "description": "Returns the Payment", + "title": "GetPayment Response" + }, "pbListAccountsResponse": { "type": "object", "properties": { @@ -1186,7 +1232,7 @@ "pbUpdateAccountRequest": { "type": "object", "example": { - "id": "195", + "id": "1", "street": "Death Star 2" }, "properties": { diff --git a/bff/gapi/rpc_get_payment.go b/bff/gapi/rpc_get_payment.go new file mode 100644 index 0000000..ed72d10 --- /dev/null +++ b/bff/gapi/rpc_get_payment.go @@ -0,0 +1,66 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) (*pb.GetPaymentResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateGetPaymentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + payment, err := server.store.GetPayment(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Error(codes.NotFound, "no payments found") + } + return nil, status.Error(codes.NotFound, "failed to get payments") + } + + if account.ID != payment.AccountID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + rsp := &pb.GetPaymentResponse{ + Payment: convertPayment(payment), + } + + return rsp, nil +} + +func validateGetPaymentRequest(req *pb.GetPaymentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/pb/rpc_get_payment.pb.go b/bff/pb/rpc_get_payment.pb.go new file mode 100644 index 0000000..81f676f --- /dev/null +++ b/bff/pb/rpc_get_payment.pb.go @@ -0,0 +1,222 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_get_payment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetPaymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetPaymentRequest) Reset() { + *x = GetPaymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_get_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPaymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPaymentRequest) ProtoMessage() {} + +func (x *GetPaymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_get_payment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPaymentRequest.ProtoReflect.Descriptor instead. +func (*GetPaymentRequest) Descriptor() ([]byte, []int) { + return file_rpc_get_payment_proto_rawDescGZIP(), []int{0} +} + +func (x *GetPaymentRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetPaymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payment *Payment `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` +} + +func (x *GetPaymentResponse) Reset() { + *x = GetPaymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_get_payment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPaymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPaymentResponse) ProtoMessage() {} + +func (x *GetPaymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_get_payment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPaymentResponse.ProtoReflect.Descriptor instead. +func (*GetPaymentResponse) Descriptor() ([]byte, []int) { + return file_rpc_get_payment_proto_rawDescGZIP(), []int{1} +} + +func (x *GetPaymentResponse) GetPayment() *Payment { + if x != nil { + return x.Payment + } + return nil +} + +var File_rpc_get_payment_proto protoreflect.FileDescriptor + +var file_rpc_get_payment_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, + 0x3a, 0x92, 0x41, 0x37, 0x0a, 0x27, 0x2a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x32, 0x14, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0c, 0x7b, + 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x22, 0x71, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, + 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x2f, 0x92, + 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x13, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, + 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, + 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_rpc_get_payment_proto_rawDescOnce sync.Once + file_rpc_get_payment_proto_rawDescData = file_rpc_get_payment_proto_rawDesc +) + +func file_rpc_get_payment_proto_rawDescGZIP() []byte { + file_rpc_get_payment_proto_rawDescOnce.Do(func() { + file_rpc_get_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_get_payment_proto_rawDescData) + }) + return file_rpc_get_payment_proto_rawDescData +} + +var file_rpc_get_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_get_payment_proto_goTypes = []interface{}{ + (*GetPaymentRequest)(nil), // 0: pb.GetPaymentRequest + (*GetPaymentResponse)(nil), // 1: pb.GetPaymentResponse + (*Payment)(nil), // 2: pb.Payment +} +var file_rpc_get_payment_proto_depIdxs = []int32{ + 2, // 0: pb.GetPaymentResponse.payment:type_name -> pb.Payment + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_get_payment_proto_init() } +func file_rpc_get_payment_proto_init() { + if File_rpc_get_payment_proto != nil { + return + } + file_payment_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_get_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPaymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_get_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPaymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_get_payment_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_get_payment_proto_goTypes, + DependencyIndexes: file_rpc_get_payment_proto_depIdxs, + MessageInfos: file_rpc_get_payment_proto_msgTypes, + }.Build() + File_rpc_get_payment_proto = out.File + file_rpc_get_payment_proto_rawDesc = nil + file_rpc_get_payment_proto_goTypes = nil + file_rpc_get_payment_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_list_payments.pb.go b/bff/pb/rpc_list_payments.pb.go index 5dec19c..efe4992 100644 --- a/bff/pb/rpc_list_payments.pb.go +++ b/bff/pb/rpc_list_payments.pb.go @@ -123,25 +123,26 @@ var file_rpc_list_payments_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x49, 0x64, 0x3a, 0x48, 0x92, 0x41, 0x45, 0x0a, 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, - 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x12, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x64, 0x3a, 0x50, 0x92, 0x41, 0x4d, 0x0a, 0x37, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x32, 0x12, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, + 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, + 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, + 0x00, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, + 0x0a, 0x2c, 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, + 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, + 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/bff/pb/rpc_update_account.pb.go b/bff/pb/rpc_update_account.pb.go index eb2b6ff..872f02b 100644 --- a/bff/pb/rpc_update_account.pb.go +++ b/bff/pb/rpc_update_account.pb.go @@ -206,7 +206,7 @@ var file_rpc_update_account_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, + 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x04, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, @@ -231,29 +231,29 @@ var file_rpc_update_account_proto_rawDesc = []byte{ 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x48, 0x09, 0x52, 0x08, 0x62, 0x69, 0x72, - 0x74, 0x68, 0x64, 0x61, 0x79, 0x88, 0x01, 0x01, 0x3a, 0x56, 0x92, 0x41, 0x53, 0x0a, 0x28, 0x2a, + 0x74, 0x68, 0x64, 0x61, 0x79, 0x88, 0x01, 0x01, 0x3a, 0x54, 0x92, 0x41, 0x51, 0x0a, 0x28, 0x2a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x27, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, - 0x22, 0x31, 0x39, 0x35, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, 0x3a, - 0x20, 0x22, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x53, 0x74, 0x61, 0x72, 0x20, 0x32, 0x22, 0x7d, - 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, - 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x42, 0x07, 0x0a, - 0x05, 0x5f, 0x63, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x7a, 0x69, 0x70, 0x42, 0x0a, - 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, - 0x68, 0x6f, 0x6e, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, - 0x79, 0x22, 0x78, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x1b, - 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, - 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x25, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, + 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, 0x3a, 0x20, 0x22, + 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x53, 0x74, 0x61, 0x72, 0x20, 0x32, 0x22, 0x7d, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, + 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, + 0x63, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x7a, 0x69, 0x70, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x68, 0x6f, + 0x6e, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, + 0x78, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x1b, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, + 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index fd949a3..16ea507 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -39,131 +39,140 @@ var file_service_df_proto_rawDesc = []byte{ 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, - 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, + 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, + 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, - 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xc9, 0x0c, 0x0a, - 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, - 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0xc7, 0x0d, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, + 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, + 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, + 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, + 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0a, 0x47, 0x65, - 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x7a, - 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, - 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, - 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, - 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, - 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, + 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, + 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, + 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, + 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, + 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, + 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, - 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, - 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x0d, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, - 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, - 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0d, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, - 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x1a, - 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, - 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, - 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, - 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, - 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, - 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, - 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, - 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, + 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, + 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, + 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, + 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -178,21 +187,23 @@ var file_service_df_proto_goTypes = []interface{}{ (*UpdateAccountPrivacyRequest)(nil), // 8: pb.UpdateAccountPrivacyRequest (*CreatePersonRequest)(nil), // 9: pb.CreatePersonRequest (*CreatePaymentRequest)(nil), // 10: pb.CreatePaymentRequest - (*ListPaymentsRequest)(nil), // 11: pb.ListPaymentsRequest - (*UpdatePaymentRequest)(nil), // 12: pb.UpdatePaymentRequest - (*LoginResponse)(nil), // 13: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 14: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 15: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 16: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 17: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 18: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 19: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 20: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 21: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 22: pb.CreatePersonResponse - (*CreatePaymentResponse)(nil), // 23: pb.CreatePaymentResponse - (*ListPaymentsResponse)(nil), // 24: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 25: pb.UpdatePaymentResponse + (*GetPaymentRequest)(nil), // 11: pb.GetPaymentRequest + (*ListPaymentsRequest)(nil), // 12: pb.ListPaymentsRequest + (*UpdatePaymentRequest)(nil), // 13: pb.UpdatePaymentRequest + (*LoginResponse)(nil), // 14: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 15: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 16: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 17: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 18: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 19: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 20: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 21: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 22: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 23: pb.CreatePersonResponse + (*CreatePaymentResponse)(nil), // 24: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 25: pb.GetPaymentResponse + (*ListPaymentsResponse)(nil), // 26: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 27: pb.UpdatePaymentResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -206,23 +217,25 @@ var file_service_df_proto_depIdxs = []int32{ 8, // 8: pb.df.UpdateAccountPrivacy:input_type -> pb.UpdateAccountPrivacyRequest 9, // 9: pb.df.CreatePerson:input_type -> pb.CreatePersonRequest 10, // 10: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest - 11, // 11: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest - 12, // 12: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest - 13, // 13: pb.df.Login:output_type -> pb.LoginResponse - 14, // 14: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 15, // 15: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 16, // 16: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 17, // 17: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 18, // 18: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 19, // 19: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 20, // 20: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 21, // 21: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 22, // 22: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 23, // 23: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 24, // 24: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 25, // 25: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 13, // [13:26] is the sub-list for method output_type - 0, // [0:13] is the sub-list for method input_type + 11, // 11: pb.df.GetPayment:input_type -> pb.GetPaymentRequest + 12, // 12: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest + 13, // 13: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest + 14, // 14: pb.df.Login:output_type -> pb.LoginResponse + 15, // 15: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 16, // 16: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 17, // 17: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 18, // 18: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 19, // 19: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 20, // 20: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 21, // 21: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 22, // 22: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 23, // 23: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 24, // 24: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 25, // 25: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 26, // 26: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 27, // 27: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 14, // [14:28] is the sub-list for method output_type + 0, // [0:14] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -239,6 +252,7 @@ func file_service_df_proto_init() { file_rpc_update_account_proto_init() file_rpc_update_payment_proto_init() file_rpc_get_account_proto_init() + file_rpc_get_payment_proto_init() file_rpc_list_accounts_proto_init() file_rpc_list_payments_proto_init() file_rpc_list_sessions_proto_init() diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 2ec53aa..5ef4412 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -185,19 +185,25 @@ func local_request_Df_BlockSession_0(ctx context.Context, marshaler runtime.Mars } -var ( - filter_Df_GetAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - func request_Df_GetAccount_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetAccountRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_GetAccount_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } msg, err := client.GetAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -209,11 +215,21 @@ func local_request_Df_GetAccount_0(ctx context.Context, marshaler runtime.Marsha var protoReq GetAccountRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_GetAccount_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } msg, err := server.GetAccount(ctx, &protoReq) @@ -427,6 +443,58 @@ func local_request_Df_CreatePayment_0(ctx context.Context, marshaler runtime.Mar } +func request_Df_GetPayment_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPaymentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetPayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_GetPayment_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPaymentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetPayment(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Df_ListPayments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -611,7 +679,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -778,6 +846,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("GET", pattern_Df_GetPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetPayment", runtime.WithHTTPPathPattern("/v1/payments/get_payment/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_GetPayment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_GetPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -963,7 +1056,7 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetAccount", runtime.WithHTTPPathPattern("/v1/accounts/get_account/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1111,6 +1204,28 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("GET", pattern_Df_GetPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetPayment", runtime.WithHTTPPathPattern("/v1/payments/get_payment/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_GetPayment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_GetPayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1167,7 +1282,7 @@ var ( pattern_Df_BlockSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sessions", "block_session"}, "")) - pattern_Df_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "get_account"}, "")) + pattern_Df_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "accounts", "get_account", "id"}, "")) pattern_Df_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "accounts", "list_accounts"}, "")) @@ -1181,6 +1296,8 @@ var ( pattern_Df_CreatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "create_payment"}, "")) + pattern_Df_GetPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payments", "get_payment", "id"}, "")) + pattern_Df_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "list_payments"}, "")) pattern_Df_UpdatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "update_payment"}, "")) @@ -1209,6 +1326,8 @@ var ( forward_Df_CreatePayment_0 = runtime.ForwardResponseMessage + forward_Df_GetPayment_0 = runtime.ForwardResponseMessage + forward_Df_ListPayments_0 = runtime.ForwardResponseMessage forward_Df_UpdatePayment_0 = runtime.ForwardResponseMessage diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index b526f09..9e6ec79 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -30,6 +30,7 @@ const ( Df_UpdateAccountPrivacy_FullMethodName = "/pb.df/UpdateAccountPrivacy" Df_CreatePerson_FullMethodName = "/pb.df/CreatePerson" Df_CreatePayment_FullMethodName = "/pb.df/CreatePayment" + Df_GetPayment_FullMethodName = "/pb.df/GetPayment" Df_ListPayments_FullMethodName = "/pb.df/ListPayments" Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" ) @@ -49,6 +50,7 @@ type DfClient interface { UpdateAccountPrivacy(ctx context.Context, in *UpdateAccountPrivacyRequest, opts ...grpc.CallOption) (*UpdateAccountPrivacyResponse, error) CreatePerson(ctx context.Context, in *CreatePersonRequest, opts ...grpc.CallOption) (*CreatePersonResponse, error) CreatePayment(ctx context.Context, in *CreatePaymentRequest, opts ...grpc.CallOption) (*CreatePaymentResponse, error) + GetPayment(ctx context.Context, in *GetPaymentRequest, opts ...grpc.CallOption) (*GetPaymentResponse, error) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) } @@ -160,6 +162,15 @@ func (c *dfClient) CreatePayment(ctx context.Context, in *CreatePaymentRequest, return out, nil } +func (c *dfClient) GetPayment(ctx context.Context, in *GetPaymentRequest, opts ...grpc.CallOption) (*GetPaymentResponse, error) { + out := new(GetPaymentResponse) + err := c.cc.Invoke(ctx, Df_GetPayment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfClient) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) { out := new(ListPaymentsResponse) err := c.cc.Invoke(ctx, Df_ListPayments_FullMethodName, in, out, opts...) @@ -193,6 +204,7 @@ type DfServer interface { UpdateAccountPrivacy(context.Context, *UpdateAccountPrivacyRequest) (*UpdateAccountPrivacyResponse, error) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) + GetPayment(context.Context, *GetPaymentRequest) (*GetPaymentResponse, error) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) mustEmbedUnimplementedDfServer() @@ -235,6 +247,9 @@ func (UnimplementedDfServer) CreatePerson(context.Context, *CreatePersonRequest) func (UnimplementedDfServer) CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePayment not implemented") } +func (UnimplementedDfServer) GetPayment(context.Context, *GetPaymentRequest) (*GetPaymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPayment not implemented") +} func (UnimplementedDfServer) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListPayments not implemented") } @@ -452,6 +467,24 @@ func _Df_CreatePayment_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Df_GetPayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPaymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).GetPayment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_GetPayment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).GetPayment(ctx, req.(*GetPaymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Df_ListPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPaymentsRequest) if err := dec(in); err != nil { @@ -539,6 +572,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePayment", Handler: _Df_CreatePayment_Handler, }, + { + MethodName: "GetPayment", + Handler: _Df_GetPayment_Handler, + }, { MethodName: "ListPayments", Handler: _Df_ListPayments_Handler, diff --git a/bff/proto/rpc_get_payment.proto b/bff/proto/rpc_get_payment.proto new file mode 100644 index 0000000..576a2f3 --- /dev/null +++ b/bff/proto/rpc_get_payment.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "payment.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message GetPaymentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "GetPayment"; + description: "Get an Payment by ID"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\" }"; + }; + int64 id = 1; +} + +message GetPaymentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "GetPayment Response"; + description: "Returns the Payment"; + }; + }; + Payment payment = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_list_payments.proto b/bff/proto/rpc_list_payments.proto index b994548..fa7ffb3 100644 --- a/bff/proto/rpc_list_payments.proto +++ b/bff/proto/rpc_list_payments.proto @@ -14,7 +14,7 @@ message ListPaymentsRequest { title: "ListPayments"; description: "Returns a List of Payments"; required: [ - "id" + "account_id" ]; }; example: "{\"account_id\": 1 }"; diff --git a/bff/proto/rpc_update_account.proto b/bff/proto/rpc_update_account.proto index 6ee2e43..689c4d7 100644 --- a/bff/proto/rpc_update_account.proto +++ b/bff/proto/rpc_update_account.proto @@ -18,7 +18,7 @@ message UpdateAccountRequest { "id" ]; }; - example: "{\"id\": \"195\", \"street\": \"Death Star 2\"}"; + example: "{\"id\": \"1\", \"street\": \"Death Star 2\"}"; }; int64 id = 1; optional string email = 2; diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index d57601f..897fed0 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -11,6 +11,7 @@ import "rpc_create_payment.proto"; import "rpc_update_account.proto"; import "rpc_update_payment.proto"; import "rpc_get_account.proto"; +import "rpc_get_payment.proto"; import "rpc_list_accounts.proto"; import "rpc_list_payments.proto"; import "rpc_list_sessions.proto"; @@ -94,7 +95,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; rpc GetAccount (GetAccountRequest) returns (GetAccountResponse) { option (google.api.http) = { - get: "/v1/accounts/get_account" + get: "/v1/accounts/get_account/{id}" // get: "/v1/accounts/{id=id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { @@ -181,6 +182,19 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc GetPayment (GetPaymentRequest) returns (GetPaymentResponse) { + option (google.api.http) = { + get: "/v1/payments/get_payment/{id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { option (google.api.http) = { get: "/v1/payments/list_payments" From bfdbbe7e04adf256fb9f19e4150389971f042f36 Mon Sep 17 00:00:00 2001 From: itsscb Date: Mon, 9 Oct 2023 03:34:10 +0200 Subject: [PATCH 04/15] ft/adds endpoints - get_person - list_persons - delete_payment - delete_person (TODO: Add removal of returnsLog to TX) --- bff/db/mock/store.go | 16 +- bff/db/query/person.sql | 7 +- bff/db/sqlc/person.sql.go | 12 +- bff/db/sqlc/person_test.go | 19 -- bff/db/sqlc/querier.go | 2 +- bff/db/sqlc/store.go | 1 + bff/db/sqlc/tx_delete_person.go | 21 ++ bff/doc/swagger/df.swagger.json | 210 ++++++++++++- bff/gapi/converter.go | 1 + bff/gapi/rpc_delete_payment.go | 72 +++++ bff/gapi/rpc_delete_person.go | 72 +++++ bff/gapi/rpc_get_person.go | 66 +++++ bff/gapi/rpc_list_persons.go | 71 +++++ bff/pb/person.pb.go | 15 +- bff/pb/rpc_delete_payment.pb.go | 227 ++++++++++++++ bff/pb/rpc_delete_person.pb.go | 226 ++++++++++++++ bff/pb/rpc_get_person.pb.go | 221 ++++++++++++++ bff/pb/rpc_list_persons.pb.go | 224 ++++++++++++++ bff/pb/service_df.pb.go | 395 ++++++++++++++----------- bff/pb/service_df.pb.gw.go | 456 ++++++++++++++++++++++++++++- bff/pb/service_df_grpc.pb.go | 148 ++++++++++ bff/proto/person.proto | 3 +- bff/proto/rpc_delete_payment.proto | 32 ++ bff/proto/rpc_delete_person.proto | 32 ++ bff/proto/rpc_get_person.proto | 34 +++ bff/proto/rpc_list_persons.proto | 34 +++ bff/proto/service_df.proto | 58 +++- 27 files changed, 2452 insertions(+), 223 deletions(-) create mode 100644 bff/db/sqlc/tx_delete_person.go create mode 100644 bff/gapi/rpc_delete_payment.go create mode 100644 bff/gapi/rpc_delete_person.go create mode 100644 bff/gapi/rpc_get_person.go create mode 100644 bff/gapi/rpc_list_persons.go create mode 100644 bff/pb/rpc_delete_payment.pb.go create mode 100644 bff/pb/rpc_delete_person.pb.go create mode 100644 bff/pb/rpc_get_person.pb.go create mode 100644 bff/pb/rpc_list_persons.pb.go create mode 100644 bff/proto/rpc_delete_payment.proto create mode 100644 bff/proto/rpc_delete_person.proto create mode 100644 bff/proto/rpc_get_person.proto create mode 100644 bff/proto/rpc_list_persons.proto diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index 25683ca..a5c15ce 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -318,6 +318,20 @@ func (mr *MockStoreMockRecorder) DeletePerson(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePerson", reflect.TypeOf((*MockStore)(nil).DeletePerson), arg0, arg1) } +// DeletePersonTx mocks base method. +func (m *MockStore) DeletePersonTx(arg0 context.Context, arg1 int64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeletePersonTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeletePersonTx indicates an expected call of DeletePersonTx. +func (mr *MockStoreMockRecorder) DeletePersonTx(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePersonTx", reflect.TypeOf((*MockStore)(nil).DeletePersonTx), arg0, arg1) +} + // DeleteProvider mocks base method. func (m *MockStore) DeleteProvider(arg0 context.Context, arg1 int64) error { m.ctrl.T.Helper() @@ -616,7 +630,7 @@ func (mr *MockStoreMockRecorder) ListPayments(arg0, arg1 any) *gomock.Call { } // ListPersons mocks base method. -func (m *MockStore) ListPersons(arg0 context.Context, arg1 db.ListPersonsParams) ([]db.Person, error) { +func (m *MockStore) ListPersons(arg0 context.Context, arg1 int64) ([]db.Person, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListPersons", arg0, arg1) ret0, _ := ret[0].([]db.Person) diff --git a/bff/db/query/person.sql b/bff/db/query/person.sql index e9c7436..4c1fe63 100644 --- a/bff/db/query/person.sql +++ b/bff/db/query/person.sql @@ -20,9 +20,8 @@ INSERT INTO persons ( -- name: ListPersons :many SELECT * FROM persons -ORDER BY "lastname", "firstname" -LIMIT $1 -OFFSET $2; +WHERE "account_id" = sqlc.arg(account_id) +ORDER BY "lastname", "firstname"; -- name: UpdatePerson :one UPDATE persons @@ -42,7 +41,7 @@ RETURNING *; -- name: DeletePerson :exec DELETE FROM persons -WHERE "id" = $1; +WHERE "id" = sqlc.arg(id); -- name: GetReturns :many SELECT * FROM returns diff --git a/bff/db/sqlc/person.sql.go b/bff/db/sqlc/person.sql.go index 45db78d..0520c8f 100644 --- a/bff/db/sqlc/person.sql.go +++ b/bff/db/sqlc/person.sql.go @@ -152,18 +152,12 @@ func (q *Queries) GetReturns(ctx context.Context, id int64) ([]Return, error) { const listPersons = `-- name: ListPersons :many SELECT id, account_id, firstname, lastname, birthday, city, zip, street, country, creator, created, changer, changed FROM persons +WHERE "account_id" = $1 ORDER BY "lastname", "firstname" -LIMIT $1 -OFFSET $2 ` -type ListPersonsParams struct { - Limit int32 `json:"limit"` - Offset int32 `json:"offset"` -} - -func (q *Queries) ListPersons(ctx context.Context, arg ListPersonsParams) ([]Person, error) { - rows, err := q.db.QueryContext(ctx, listPersons, arg.Limit, arg.Offset) +func (q *Queries) ListPersons(ctx context.Context, accountID int64) ([]Person, error) { + rows, err := q.db.QueryContext(ctx, listPersons, accountID) if err != nil { return nil, err } diff --git a/bff/db/sqlc/person_test.go b/bff/db/sqlc/person_test.go index 9e999f4..8a1256c 100644 --- a/bff/db/sqlc/person_test.go +++ b/bff/db/sqlc/person_test.go @@ -104,22 +104,3 @@ func TestUpdatePerson(t *testing.T) { require.Equal(t, person1.Firstname, person2.Firstname) require.NotEqual(t, person1.Lastname, person2.Lastname) } - -func TestListPersons(t *testing.T) { - for i := 0; i < 10; i++ { - createRandomPerson(t) - } - - arg := ListPersonsParams{ - Limit: 5, - Offset: 5, - } - - persons, err := testQueries.ListPersons(context.Background(), arg) - require.NoError(t, err) - require.Len(t, persons, 5) - - for _, person := range persons { - require.NotEmpty(t, person) - } -} diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index e825160..0322bae 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -61,7 +61,7 @@ type Querier interface { ListDocuments(ctx context.Context, arg ListDocumentsParams) ([]Document, error) ListMails(ctx context.Context, arg ListMailsParams) ([]Mail, error) ListPayments(ctx context.Context, accountID int64) ([]Payment, error) - ListPersons(ctx context.Context, arg ListPersonsParams) ([]Person, error) + ListPersons(ctx context.Context, accountID int64) ([]Person, error) ListProviders(ctx context.Context, arg ListProvidersParams) ([]Provider, error) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams) ([]ReturnsLog, error) diff --git a/bff/db/sqlc/store.go b/bff/db/sqlc/store.go index ca46c26..fc50379 100644 --- a/bff/db/sqlc/store.go +++ b/bff/db/sqlc/store.go @@ -12,6 +12,7 @@ type Store interface { UpdateAccountTx(ctx context.Context, arg UpdateAccountTxParams) (Account, error) UpdateAccountPrivacyTx(ctx context.Context, arg UpdateAccountPrivacyTxParams) (Account, error) CreatePersonTx(ctx context.Context, arg CreatePersonTxParams) (Person, error) + DeletePersonTx(ctx context.Context, id int64) error } // Store provides all functions to execute db queries and transactions diff --git a/bff/db/sqlc/tx_delete_person.go b/bff/db/sqlc/tx_delete_person.go new file mode 100644 index 0000000..1aa2a8e --- /dev/null +++ b/bff/db/sqlc/tx_delete_person.go @@ -0,0 +1,21 @@ +package db + +import ( + "context" +) + +func (store *SQLStore) DeletePersonTx(ctx context.Context, id int64) error { + err := store.execTx(ctx, func(q *Queries) error { + + // TODO: Add removal of db.returnsLog entries. + + err := q.DeletePerson(ctx, id) + if err != nil { + return err + } + + return err + }) + + return err +} diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index d49bf24..490e23b 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -285,6 +285,42 @@ ] } }, + "/v1/payments/delete_payment/{id}": { + "delete": { + "operationId": "df_DeletePayment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeletePaymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/payments/get_payment/{id}": { "get": { "operationId": "df_GetPayment", @@ -321,7 +357,7 @@ ] } }, - "/v1/payments/list_payments": { + "/v1/payments/list_payments/{accountId}": { "get": { "operationId": "df_ListPayments", "responses": { @@ -341,7 +377,7 @@ "parameters": [ { "name": "accountId", - "in": "query", + "in": "path", "required": true, "type": "string", "format": "int64" @@ -433,6 +469,114 @@ ] } }, + "/v1/persons/delete_person/{id}": { + "delete": { + "operationId": "df_DeletePerson", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeletePersonResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/persons/get_person/{id}": { + "get": { + "operationId": "df_GetPerson", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetPersonResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, + "/v1/persons/list_persons/{accountId}": { + "get": { + "operationId": "df_ListPersons", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListPersonsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "accountId", + "in": "path", + "required": true, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/sessions/block_session": { "patch": { "operationId": "df_BlockSession", @@ -862,6 +1006,40 @@ "description": "Returns the created Person", "title": "Created Person" }, + "pbDeletePaymentResponse": { + "type": "object", + "example": { + "id": "1", + "deleted": true + }, + "properties": { + "id": { + "type": "string", + "format": "int64" + }, + "deleted": { + "type": "boolean" + } + }, + "title": "Delete Payment Response" + }, + "pbDeletePersonResponse": { + "type": "object", + "example": { + "id": "1", + "deleted": true + }, + "properties": { + "id": { + "type": "string", + "format": "int64" + }, + "deleted": { + "type": "boolean" + } + }, + "title": "Delete Person Response" + }, "pbGetAccountResponse": { "type": "object", "properties": { @@ -882,6 +1060,16 @@ "description": "Returns the Payment", "title": "GetPayment Response" }, + "pbGetPersonResponse": { + "type": "object", + "properties": { + "person": { + "$ref": "#/definitions/pbPerson" + } + }, + "description": "Returns the Person", + "title": "GetPerson Response" + }, "pbListAccountsResponse": { "type": "object", "properties": { @@ -910,6 +1098,20 @@ "description": "Returns the Payment", "title": "ListPayments Response" }, + "pbListPersonsResponse": { + "type": "object", + "properties": { + "persons": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbPerson" + } + } + }, + "description": "Returns the Person", + "title": "ListPersons Response" + }, "pbListSessionsResponse": { "type": "object", "properties": { @@ -1069,6 +1271,10 @@ "changed": "2023-10-05T02:30:53Z" }, "properties": { + "id": { + "type": "string", + "format": "int64" + }, "accountId": { "type": "string", "format": "int64" diff --git a/bff/gapi/converter.go b/bff/gapi/converter.go index 6b96c41..4ed5af9 100644 --- a/bff/gapi/converter.go +++ b/bff/gapi/converter.go @@ -30,6 +30,7 @@ func convertAccount(account db.Account) *pb.Account { func convertPerson(person db.Person) *pb.Person { return &pb.Person{ + Id: person.ID, AccountId: person.AccountID, Firstname: person.Firstname, Lastname: person.Lastname, diff --git a/bff/gapi/rpc_delete_payment.go b/bff/gapi/rpc_delete_payment.go new file mode 100644 index 0000000..4077a54 --- /dev/null +++ b/bff/gapi/rpc_delete_payment.go @@ -0,0 +1,72 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRequest) (*pb.DeletePaymentResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateDeletePaymentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + payment, err := server.store.GetPayment(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "payment not found") + } + return nil, status.Errorf(codes.Internal, "failed to get payment") + } + + if payment.AccountID != account.ID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "payment not found") + } + } + + err = server.store.DeletePayment(ctx, req.GetId()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to block payment") + + } + + rsp := &pb.DeletePaymentResponse{ + Id: req.GetId(), + Deleted: true, + } + return rsp, nil +} + +func validateDeletePaymentRequest(req *pb.DeletePaymentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/gapi/rpc_delete_person.go b/bff/gapi/rpc_delete_person.go new file mode 100644 index 0000000..8f11972 --- /dev/null +++ b/bff/gapi/rpc_delete_person.go @@ -0,0 +1,72 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequest) (*pb.DeletePersonResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateDeletePersonRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + person, err := server.store.GetPerson(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "person not found") + } + return nil, status.Errorf(codes.Internal, "failed to get person") + } + + if person.AccountID != account.ID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "person not found") + } + } + + err = server.store.DeletePersonTx(ctx, person.ID) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to delete person") + + } + + rsp := &pb.DeletePersonResponse{ + Id: req.GetId(), + Deleted: true, + } + return rsp, nil +} + +func validateDeletePersonRequest(req *pb.DeletePersonRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/gapi/rpc_get_person.go b/bff/gapi/rpc_get_person.go new file mode 100644 index 0000000..7687a39 --- /dev/null +++ b/bff/gapi/rpc_get_person.go @@ -0,0 +1,66 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) (*pb.GetPersonResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateGetPersonRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + person, err := server.store.GetPerson(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Error(codes.NotFound, "no persons found") + } + return nil, status.Error(codes.NotFound, "failed to get persons") + } + + if account.ID != person.AccountID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + rsp := &pb.GetPersonResponse{ + Person: convertPerson(person), + } + + return rsp, nil +} + +func validateGetPersonRequest(req *pb.GetPersonRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/gapi/rpc_list_persons.go b/bff/gapi/rpc_list_persons.go new file mode 100644 index 0000000..ef4ffa4 --- /dev/null +++ b/bff/gapi/rpc_list_persons.go @@ -0,0 +1,71 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsRequest) (*pb.ListPersonsResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateListPersonsRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + if account.ID != req.GetAccountId() { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + dbPersons, err := server.store.ListPersons(ctx, req.GetAccountId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Error(codes.NotFound, "no persons found") + } + return nil, status.Error(codes.NotFound, "failed to get persons") + } + + var persons []*pb.Person + for _, a := range dbPersons { + persons = append(persons, convertPerson(a)) + } + + rsp := &pb.ListPersonsResponse{ + Persons: persons, + } + + return rsp, nil +} + +func validateListPersonsRequest(req *pb.ListPersonsRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetAccountId() < 1 { + violations = append(violations, fieldViolation("account_id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/pb/person.pb.go b/bff/pb/person.pb.go index 6e5762c..cc6ca1e 100644 --- a/bff/pb/person.pb.go +++ b/bff/pb/person.pb.go @@ -27,7 +27,8 @@ type Person struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AccountId int64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` Firstname string `protobuf:"bytes,3,opt,name=firstname,proto3" json:"firstname,omitempty"` Lastname string `protobuf:"bytes,4,opt,name=lastname,proto3" json:"lastname,omitempty"` Street string `protobuf:"bytes,5,opt,name=street,proto3" json:"street,omitempty"` @@ -73,6 +74,13 @@ func (*Person) Descriptor() ([]byte, []int) { return file_person_proto_rawDescGZIP(), []int{0} } +func (x *Person) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + func (x *Person) GetAccountId() int64 { if x != nil { return x.AccountId @@ -166,8 +174,9 @@ var file_person_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x07, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x07, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, diff --git a/bff/pb/rpc_delete_payment.pb.go b/bff/pb/rpc_delete_payment.pb.go new file mode 100644 index 0000000..7d0d41a --- /dev/null +++ b/bff/pb/rpc_delete_payment.pb.go @@ -0,0 +1,227 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_delete_payment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DeletePaymentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeletePaymentRequest) Reset() { + *x = DeletePaymentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePaymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePaymentRequest) ProtoMessage() {} + +func (x *DeletePaymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_payment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePaymentRequest.ProtoReflect.Descriptor instead. +func (*DeletePaymentRequest) Descriptor() ([]byte, []int) { + return file_rpc_delete_payment_proto_rawDescGZIP(), []int{0} +} + +func (x *DeletePaymentRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DeletePaymentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` +} + +func (x *DeletePaymentResponse) Reset() { + *x = DeletePaymentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_payment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePaymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePaymentResponse) ProtoMessage() {} + +func (x *DeletePaymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_payment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePaymentResponse.ProtoReflect.Descriptor instead. +func (*DeletePaymentResponse) Descriptor() ([]byte, []int) { + return file_rpc_delete_payment_proto_rawDescGZIP(), []int{1} +} + +func (x *DeletePaymentResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeletePaymentResponse) GetDeleted() bool { + if x != nil { + return x.Deleted + } + return false +} + +var File_rpc_delete_payment_proto protoreflect.FileDescriptor + +var file_rpc_delete_payment_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x61, + 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x39, 0x92, 0x41, 0x36, 0x0a, 0x27, 0x2a, 0x0e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x10, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0xd2, + 0x01, 0x02, 0x69, 0x64, 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, + 0x7d, 0x22, 0x7f, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x3a, 0x3c, 0x92, 0x41, 0x39, 0x0a, 0x19, 0x2a, 0x17, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x1c, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, + 0x2c, 0x20, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, + 0x65, 0x7d, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_delete_payment_proto_rawDescOnce sync.Once + file_rpc_delete_payment_proto_rawDescData = file_rpc_delete_payment_proto_rawDesc +) + +func file_rpc_delete_payment_proto_rawDescGZIP() []byte { + file_rpc_delete_payment_proto_rawDescOnce.Do(func() { + file_rpc_delete_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_delete_payment_proto_rawDescData) + }) + return file_rpc_delete_payment_proto_rawDescData +} + +var file_rpc_delete_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_delete_payment_proto_goTypes = []interface{}{ + (*DeletePaymentRequest)(nil), // 0: pb.DeletePaymentRequest + (*DeletePaymentResponse)(nil), // 1: pb.DeletePaymentResponse +} +var file_rpc_delete_payment_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rpc_delete_payment_proto_init() } +func file_rpc_delete_payment_proto_init() { + if File_rpc_delete_payment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpc_delete_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePaymentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_delete_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePaymentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_delete_payment_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_delete_payment_proto_goTypes, + DependencyIndexes: file_rpc_delete_payment_proto_depIdxs, + MessageInfos: file_rpc_delete_payment_proto_msgTypes, + }.Build() + File_rpc_delete_payment_proto = out.File + file_rpc_delete_payment_proto_rawDesc = nil + file_rpc_delete_payment_proto_goTypes = nil + file_rpc_delete_payment_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_delete_person.pb.go b/bff/pb/rpc_delete_person.pb.go new file mode 100644 index 0000000..0fa913c --- /dev/null +++ b/bff/pb/rpc_delete_person.pb.go @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_delete_person.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DeletePersonRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeletePersonRequest) Reset() { + *x = DeletePersonRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_person_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePersonRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePersonRequest) ProtoMessage() {} + +func (x *DeletePersonRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_person_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePersonRequest.ProtoReflect.Descriptor instead. +func (*DeletePersonRequest) Descriptor() ([]byte, []int) { + return file_rpc_delete_person_proto_rawDescGZIP(), []int{0} +} + +func (x *DeletePersonRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DeletePersonResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` +} + +func (x *DeletePersonResponse) Reset() { + *x = DeletePersonResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_person_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePersonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePersonResponse) ProtoMessage() {} + +func (x *DeletePersonResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_person_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePersonResponse.ProtoReflect.Descriptor instead. +func (*DeletePersonResponse) Descriptor() ([]byte, []int) { + return file_rpc_delete_person_proto_rawDescGZIP(), []int{1} +} + +func (x *DeletePersonResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeletePersonResponse) GetDeleted() bool { + if x != nil { + return x.Deleted + } + return false +} + +var File_rpc_delete_person_proto protoreflect.FileDescriptor + +var file_rpc_delete_person_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5e, 0x0a, + 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x3a, 0x37, 0x92, 0x41, 0x34, 0x0a, 0x25, 0x2a, 0x0d, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x0f, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x20, 0x61, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0xd2, 0x01, 0x02, 0x69, 0x64, + 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x7d, 0x22, 0x7d, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x3a, + 0x3b, 0x92, 0x41, 0x38, 0x0a, 0x18, 0x2a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x1c, + 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x42, 0x19, 0x5a, 0x17, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, + 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_delete_person_proto_rawDescOnce sync.Once + file_rpc_delete_person_proto_rawDescData = file_rpc_delete_person_proto_rawDesc +) + +func file_rpc_delete_person_proto_rawDescGZIP() []byte { + file_rpc_delete_person_proto_rawDescOnce.Do(func() { + file_rpc_delete_person_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_delete_person_proto_rawDescData) + }) + return file_rpc_delete_person_proto_rawDescData +} + +var file_rpc_delete_person_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_delete_person_proto_goTypes = []interface{}{ + (*DeletePersonRequest)(nil), // 0: pb.DeletePersonRequest + (*DeletePersonResponse)(nil), // 1: pb.DeletePersonResponse +} +var file_rpc_delete_person_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rpc_delete_person_proto_init() } +func file_rpc_delete_person_proto_init() { + if File_rpc_delete_person_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpc_delete_person_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePersonRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_delete_person_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePersonResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_delete_person_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_delete_person_proto_goTypes, + DependencyIndexes: file_rpc_delete_person_proto_depIdxs, + MessageInfos: file_rpc_delete_person_proto_msgTypes, + }.Build() + File_rpc_delete_person_proto = out.File + file_rpc_delete_person_proto_rawDesc = nil + file_rpc_delete_person_proto_goTypes = nil + file_rpc_delete_person_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_get_person.pb.go b/bff/pb/rpc_get_person.pb.go new file mode 100644 index 0000000..80362e3 --- /dev/null +++ b/bff/pb/rpc_get_person.pb.go @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_get_person.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetPersonRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetPersonRequest) Reset() { + *x = GetPersonRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_get_person_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPersonRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPersonRequest) ProtoMessage() {} + +func (x *GetPersonRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_get_person_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPersonRequest.ProtoReflect.Descriptor instead. +func (*GetPersonRequest) Descriptor() ([]byte, []int) { + return file_rpc_get_person_proto_rawDescGZIP(), []int{0} +} + +func (x *GetPersonRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetPersonResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Person *Person `protobuf:"bytes,1,opt,name=person,proto3" json:"person,omitempty"` +} + +func (x *GetPersonResponse) Reset() { + *x = GetPersonResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_get_person_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPersonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPersonResponse) ProtoMessage() {} + +func (x *GetPersonResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_get_person_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPersonResponse.ProtoReflect.Descriptor instead. +func (*GetPersonResponse) Descriptor() ([]byte, []int) { + return file_rpc_get_person_proto_rawDescGZIP(), []int{1} +} + +func (x *GetPersonResponse) GetPerson() *Person { + if x != nil { + return x.Person + } + return nil +} + +var File_rpc_get_person_proto protoreflect.FileDescriptor + +var file_rpc_get_person_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x70, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x38, 0x92, 0x41, + 0x35, 0x0a, 0x25, 0x2a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x13, + 0x47, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x62, 0x79, + 0x20, 0x49, 0x44, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0c, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x22, 0x6b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, + 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x06, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x3a, 0x2d, 0x92, 0x41, 0x2a, 0x0a, 0x28, 0x2a, 0x12, 0x47, 0x65, 0x74, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x12, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_get_person_proto_rawDescOnce sync.Once + file_rpc_get_person_proto_rawDescData = file_rpc_get_person_proto_rawDesc +) + +func file_rpc_get_person_proto_rawDescGZIP() []byte { + file_rpc_get_person_proto_rawDescOnce.Do(func() { + file_rpc_get_person_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_get_person_proto_rawDescData) + }) + return file_rpc_get_person_proto_rawDescData +} + +var file_rpc_get_person_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_get_person_proto_goTypes = []interface{}{ + (*GetPersonRequest)(nil), // 0: pb.GetPersonRequest + (*GetPersonResponse)(nil), // 1: pb.GetPersonResponse + (*Person)(nil), // 2: pb.Person +} +var file_rpc_get_person_proto_depIdxs = []int32{ + 2, // 0: pb.GetPersonResponse.person:type_name -> pb.Person + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_get_person_proto_init() } +func file_rpc_get_person_proto_init() { + if File_rpc_get_person_proto != nil { + return + } + file_person_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_get_person_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPersonRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_get_person_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPersonResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_get_person_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_get_person_proto_goTypes, + DependencyIndexes: file_rpc_get_person_proto_depIdxs, + MessageInfos: file_rpc_get_person_proto_msgTypes, + }.Build() + File_rpc_get_person_proto = out.File + file_rpc_get_person_proto_rawDesc = nil + file_rpc_get_person_proto_goTypes = nil + file_rpc_get_person_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_list_persons.pb.go b/bff/pb/rpc_list_persons.pb.go new file mode 100644 index 0000000..b579cbf --- /dev/null +++ b/bff/pb/rpc_list_persons.pb.go @@ -0,0 +1,224 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_list_persons.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListPersonsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *ListPersonsRequest) Reset() { + *x = ListPersonsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_persons_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPersonsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPersonsRequest) ProtoMessage() {} + +func (x *ListPersonsRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_persons_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPersonsRequest.ProtoReflect.Descriptor instead. +func (*ListPersonsRequest) Descriptor() ([]byte, []int) { + return file_rpc_list_persons_proto_rawDescGZIP(), []int{0} +} + +func (x *ListPersonsRequest) GetAccountId() int64 { + if x != nil { + return x.AccountId + } + return 0 +} + +type ListPersonsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Persons []*Person `protobuf:"bytes,1,rep,name=persons,proto3" json:"persons,omitempty"` +} + +func (x *ListPersonsResponse) Reset() { + *x = ListPersonsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_persons_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPersonsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPersonsResponse) ProtoMessage() {} + +func (x *ListPersonsResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_persons_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPersonsResponse.ProtoReflect.Descriptor instead. +func (*ListPersonsResponse) Descriptor() ([]byte, []int) { + return file_rpc_list_persons_proto_rawDescGZIP(), []int{1} +} + +func (x *ListPersonsResponse) GetPersons() []*Person { + if x != nil { + return x.Persons + } + return nil +} + +var File_rpc_list_persons_proto protoreflect.FileDescriptor + +var file_rpc_list_persons_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x3a, 0x4e, 0x92, 0x41, 0x4b, 0x0a, 0x35, 0x2a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x73, 0x32, 0x19, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, + 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0xd2, + 0x01, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x32, 0x12, 0x7b, 0x22, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, + 0x22, 0x71, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x3a, 0x2f, 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x12, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_list_persons_proto_rawDescOnce sync.Once + file_rpc_list_persons_proto_rawDescData = file_rpc_list_persons_proto_rawDesc +) + +func file_rpc_list_persons_proto_rawDescGZIP() []byte { + file_rpc_list_persons_proto_rawDescOnce.Do(func() { + file_rpc_list_persons_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_list_persons_proto_rawDescData) + }) + return file_rpc_list_persons_proto_rawDescData +} + +var file_rpc_list_persons_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_list_persons_proto_goTypes = []interface{}{ + (*ListPersonsRequest)(nil), // 0: pb.ListPersonsRequest + (*ListPersonsResponse)(nil), // 1: pb.ListPersonsResponse + (*Person)(nil), // 2: pb.Person +} +var file_rpc_list_persons_proto_depIdxs = []int32{ + 2, // 0: pb.ListPersonsResponse.persons:type_name -> pb.Person + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_list_persons_proto_init() } +func file_rpc_list_persons_proto_init() { + if File_rpc_list_persons_proto != nil { + return + } + file_person_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_list_persons_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPersonsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_list_persons_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPersonsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_list_persons_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_list_persons_proto_goTypes, + DependencyIndexes: file_rpc_list_persons_proto_depIdxs, + MessageInfos: file_rpc_list_persons_proto_msgTypes, + }.Build() + File_rpc_list_persons_proto = out.File + file_rpc_list_persons_proto_rawDesc = nil + file_rpc_list_persons_proto_goTypes = nil + file_rpc_list_persons_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index 16ea507..2ced52a 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -39,140 +39,179 @@ var file_service_df_proto_rawDesc = []byte{ 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, - 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, - 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, - 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, - 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, - 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x32, 0xc7, 0x0d, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, - 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, - 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, - 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, - 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, + 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, + 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, + 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, + 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, + 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, + 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xd4, 0x11, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, - 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, - 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, - 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, - 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, + 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, + 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, + 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, + 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, - 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, - 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, - 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, - 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, - 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, - 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, + 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, + 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, + 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, + 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, + 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, + 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, - 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, - 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -186,24 +225,32 @@ var file_service_df_proto_goTypes = []interface{}{ (*UpdateAccountRequest)(nil), // 7: pb.UpdateAccountRequest (*UpdateAccountPrivacyRequest)(nil), // 8: pb.UpdateAccountPrivacyRequest (*CreatePersonRequest)(nil), // 9: pb.CreatePersonRequest - (*CreatePaymentRequest)(nil), // 10: pb.CreatePaymentRequest - (*GetPaymentRequest)(nil), // 11: pb.GetPaymentRequest - (*ListPaymentsRequest)(nil), // 12: pb.ListPaymentsRequest - (*UpdatePaymentRequest)(nil), // 13: pb.UpdatePaymentRequest - (*LoginResponse)(nil), // 14: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 15: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 16: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 17: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 18: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 19: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 20: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 21: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 22: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 23: pb.CreatePersonResponse - (*CreatePaymentResponse)(nil), // 24: pb.CreatePaymentResponse - (*GetPaymentResponse)(nil), // 25: pb.GetPaymentResponse - (*ListPaymentsResponse)(nil), // 26: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 27: pb.UpdatePaymentResponse + (*GetPersonRequest)(nil), // 10: pb.GetPersonRequest + (*DeletePersonRequest)(nil), // 11: pb.DeletePersonRequest + (*ListPersonsRequest)(nil), // 12: pb.ListPersonsRequest + (*CreatePaymentRequest)(nil), // 13: pb.CreatePaymentRequest + (*GetPaymentRequest)(nil), // 14: pb.GetPaymentRequest + (*DeletePaymentRequest)(nil), // 15: pb.DeletePaymentRequest + (*ListPaymentsRequest)(nil), // 16: pb.ListPaymentsRequest + (*UpdatePaymentRequest)(nil), // 17: pb.UpdatePaymentRequest + (*LoginResponse)(nil), // 18: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 19: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 20: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 21: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 22: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 23: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 24: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 25: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 26: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 27: pb.CreatePersonResponse + (*GetPersonResponse)(nil), // 28: pb.GetPersonResponse + (*DeletePersonResponse)(nil), // 29: pb.DeletePersonResponse + (*ListPersonsResponse)(nil), // 30: pb.ListPersonsResponse + (*CreatePaymentResponse)(nil), // 31: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 32: pb.GetPaymentResponse + (*DeletePaymentResponse)(nil), // 33: pb.DeletePaymentResponse + (*ListPaymentsResponse)(nil), // 34: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 35: pb.UpdatePaymentResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -216,26 +263,34 @@ var file_service_df_proto_depIdxs = []int32{ 7, // 7: pb.df.UpdateAccount:input_type -> pb.UpdateAccountRequest 8, // 8: pb.df.UpdateAccountPrivacy:input_type -> pb.UpdateAccountPrivacyRequest 9, // 9: pb.df.CreatePerson:input_type -> pb.CreatePersonRequest - 10, // 10: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest - 11, // 11: pb.df.GetPayment:input_type -> pb.GetPaymentRequest - 12, // 12: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest - 13, // 13: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest - 14, // 14: pb.df.Login:output_type -> pb.LoginResponse - 15, // 15: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 16, // 16: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 17, // 17: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 18, // 18: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 19, // 19: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 20, // 20: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 21, // 21: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 22, // 22: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 23, // 23: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 24, // 24: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 25, // 25: pb.df.GetPayment:output_type -> pb.GetPaymentResponse - 26, // 26: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 27, // 27: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 14, // [14:28] is the sub-list for method output_type - 0, // [0:14] is the sub-list for method input_type + 10, // 10: pb.df.GetPerson:input_type -> pb.GetPersonRequest + 11, // 11: pb.df.DeletePerson:input_type -> pb.DeletePersonRequest + 12, // 12: pb.df.ListPersons:input_type -> pb.ListPersonsRequest + 13, // 13: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest + 14, // 14: pb.df.GetPayment:input_type -> pb.GetPaymentRequest + 15, // 15: pb.df.DeletePayment:input_type -> pb.DeletePaymentRequest + 16, // 16: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest + 17, // 17: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest + 18, // 18: pb.df.Login:output_type -> pb.LoginResponse + 19, // 19: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 20, // 20: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 21, // 21: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 22, // 22: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 23, // 23: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 24, // 24: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 25, // 25: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 26, // 26: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 27, // 27: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 28, // 28: pb.df.GetPerson:output_type -> pb.GetPersonResponse + 29, // 29: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse + 30, // 30: pb.df.ListPersons:output_type -> pb.ListPersonsResponse + 31, // 31: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 32, // 32: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 33, // 33: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse + 34, // 34: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 35, // 35: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 18, // [18:36] is the sub-list for method output_type + 0, // [0:18] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -252,8 +307,12 @@ func file_service_df_proto_init() { file_rpc_update_account_proto_init() file_rpc_update_payment_proto_init() file_rpc_get_account_proto_init() + file_rpc_delete_person_proto_init() + file_rpc_delete_payment_proto_init() + file_rpc_get_person_proto_init() file_rpc_get_payment_proto_init() file_rpc_list_accounts_proto_init() + file_rpc_list_persons_proto_init() file_rpc_list_payments_proto_init() file_rpc_list_sessions_proto_init() file_rpc_block_session_proto_init() diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 5ef4412..0de93ce 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -409,6 +409,162 @@ func local_request_Df_CreatePerson_0(ctx context.Context, marshaler runtime.Mars } +func request_Df_GetPerson_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPersonRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetPerson(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_GetPerson_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPersonRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetPerson(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Df_DeletePerson_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePersonRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeletePerson(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_DeletePerson_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePersonRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeletePerson(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Df_ListPersons_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPersonsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") + } + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) + } + + msg, err := client.ListPersons(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_ListPersons_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListPersonsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") + } + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) + } + + msg, err := server.ListPersons(ctx, &protoReq) + return msg, metadata, err + +} + func request_Df_CreatePayment_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreatePaymentRequest var metadata runtime.ServerMetadata @@ -495,19 +651,77 @@ func local_request_Df_GetPayment_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Df_ListPayments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +func request_Df_DeletePayment_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePaymentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeletePayment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_DeletePayment_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePaymentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeletePayment(ctx, &protoReq) + return msg, metadata, err + +} func request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ListPaymentsRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListPayments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } msg, err := client.ListPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -519,11 +733,21 @@ func local_request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Mars var protoReq ListPaymentsRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["account_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Df_ListPayments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.AccountId, err = runtime.Int64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } msg, err := server.ListPayments(ctx, &protoReq) @@ -821,6 +1045,81 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("GET", pattern_Df_GetPerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/GetPerson", runtime.WithHTTPPathPattern("/v1/persons/get_person/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_GetPerson_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_GetPerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Df_DeletePerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/DeletePerson", runtime.WithHTTPPathPattern("/v1/persons/delete_person/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_DeletePerson_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeletePerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Df_ListPersons_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListPersons", runtime.WithHTTPPathPattern("/v1/persons/list_persons/{account_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_ListPersons_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListPersons_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Df_CreatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -871,6 +1170,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("DELETE", pattern_Df_DeletePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/DeletePayment", runtime.WithHTTPPathPattern("/v1/payments/delete_payment/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_DeletePayment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeletePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -879,7 +1203,7 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments/{account_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1182,6 +1506,72 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("GET", pattern_Df_GetPerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/GetPerson", runtime.WithHTTPPathPattern("/v1/persons/get_person/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_GetPerson_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_GetPerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Df_DeletePerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/DeletePerson", runtime.WithHTTPPathPattern("/v1/persons/delete_person/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_DeletePerson_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeletePerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Df_ListPersons_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListPersons", runtime.WithHTTPPathPattern("/v1/persons/list_persons/{account_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_ListPersons_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListPersons_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Df_CreatePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1226,13 +1616,35 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("DELETE", pattern_Df_DeletePayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/DeletePayment", runtime.WithHTTPPathPattern("/v1/payments/delete_payment/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_DeletePayment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeletePayment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_ListPayments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListPayments", runtime.WithHTTPPathPattern("/v1/payments/list_payments/{account_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1294,11 +1706,19 @@ var ( pattern_Df_CreatePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "persons", "create_person"}, "")) + pattern_Df_GetPerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "persons", "get_person", "id"}, "")) + + pattern_Df_DeletePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "persons", "delete_person", "id"}, "")) + + pattern_Df_ListPersons_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "persons", "list_persons", "account_id"}, "")) + pattern_Df_CreatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "create_payment"}, "")) pattern_Df_GetPayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payments", "get_payment", "id"}, "")) - pattern_Df_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "list_payments"}, "")) + pattern_Df_DeletePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payments", "delete_payment", "id"}, "")) + + pattern_Df_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payments", "list_payments", "account_id"}, "")) pattern_Df_UpdatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "update_payment"}, "")) ) @@ -1324,10 +1744,18 @@ var ( forward_Df_CreatePerson_0 = runtime.ForwardResponseMessage + forward_Df_GetPerson_0 = runtime.ForwardResponseMessage + + forward_Df_DeletePerson_0 = runtime.ForwardResponseMessage + + forward_Df_ListPersons_0 = runtime.ForwardResponseMessage + forward_Df_CreatePayment_0 = runtime.ForwardResponseMessage forward_Df_GetPayment_0 = runtime.ForwardResponseMessage + forward_Df_DeletePayment_0 = runtime.ForwardResponseMessage + forward_Df_ListPayments_0 = runtime.ForwardResponseMessage forward_Df_UpdatePayment_0 = runtime.ForwardResponseMessage diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index 9e6ec79..6f970f8 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -29,8 +29,12 @@ const ( Df_UpdateAccount_FullMethodName = "/pb.df/UpdateAccount" Df_UpdateAccountPrivacy_FullMethodName = "/pb.df/UpdateAccountPrivacy" Df_CreatePerson_FullMethodName = "/pb.df/CreatePerson" + Df_GetPerson_FullMethodName = "/pb.df/GetPerson" + Df_DeletePerson_FullMethodName = "/pb.df/DeletePerson" + Df_ListPersons_FullMethodName = "/pb.df/ListPersons" Df_CreatePayment_FullMethodName = "/pb.df/CreatePayment" Df_GetPayment_FullMethodName = "/pb.df/GetPayment" + Df_DeletePayment_FullMethodName = "/pb.df/DeletePayment" Df_ListPayments_FullMethodName = "/pb.df/ListPayments" Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" ) @@ -49,8 +53,12 @@ type DfClient interface { UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*UpdateAccountResponse, error) UpdateAccountPrivacy(ctx context.Context, in *UpdateAccountPrivacyRequest, opts ...grpc.CallOption) (*UpdateAccountPrivacyResponse, error) CreatePerson(ctx context.Context, in *CreatePersonRequest, opts ...grpc.CallOption) (*CreatePersonResponse, error) + GetPerson(ctx context.Context, in *GetPersonRequest, opts ...grpc.CallOption) (*GetPersonResponse, error) + DeletePerson(ctx context.Context, in *DeletePersonRequest, opts ...grpc.CallOption) (*DeletePersonResponse, error) + ListPersons(ctx context.Context, in *ListPersonsRequest, opts ...grpc.CallOption) (*ListPersonsResponse, error) CreatePayment(ctx context.Context, in *CreatePaymentRequest, opts ...grpc.CallOption) (*CreatePaymentResponse, error) GetPayment(ctx context.Context, in *GetPaymentRequest, opts ...grpc.CallOption) (*GetPaymentResponse, error) + DeletePayment(ctx context.Context, in *DeletePaymentRequest, opts ...grpc.CallOption) (*DeletePaymentResponse, error) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) } @@ -153,6 +161,33 @@ func (c *dfClient) CreatePerson(ctx context.Context, in *CreatePersonRequest, op return out, nil } +func (c *dfClient) GetPerson(ctx context.Context, in *GetPersonRequest, opts ...grpc.CallOption) (*GetPersonResponse, error) { + out := new(GetPersonResponse) + err := c.cc.Invoke(ctx, Df_GetPerson_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dfClient) DeletePerson(ctx context.Context, in *DeletePersonRequest, opts ...grpc.CallOption) (*DeletePersonResponse, error) { + out := new(DeletePersonResponse) + err := c.cc.Invoke(ctx, Df_DeletePerson_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dfClient) ListPersons(ctx context.Context, in *ListPersonsRequest, opts ...grpc.CallOption) (*ListPersonsResponse, error) { + out := new(ListPersonsResponse) + err := c.cc.Invoke(ctx, Df_ListPersons_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfClient) CreatePayment(ctx context.Context, in *CreatePaymentRequest, opts ...grpc.CallOption) (*CreatePaymentResponse, error) { out := new(CreatePaymentResponse) err := c.cc.Invoke(ctx, Df_CreatePayment_FullMethodName, in, out, opts...) @@ -171,6 +206,15 @@ func (c *dfClient) GetPayment(ctx context.Context, in *GetPaymentRequest, opts . return out, nil } +func (c *dfClient) DeletePayment(ctx context.Context, in *DeletePaymentRequest, opts ...grpc.CallOption) (*DeletePaymentResponse, error) { + out := new(DeletePaymentResponse) + err := c.cc.Invoke(ctx, Df_DeletePayment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfClient) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) { out := new(ListPaymentsResponse) err := c.cc.Invoke(ctx, Df_ListPayments_FullMethodName, in, out, opts...) @@ -203,8 +247,12 @@ type DfServer interface { UpdateAccount(context.Context, *UpdateAccountRequest) (*UpdateAccountResponse, error) UpdateAccountPrivacy(context.Context, *UpdateAccountPrivacyRequest) (*UpdateAccountPrivacyResponse, error) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) + GetPerson(context.Context, *GetPersonRequest) (*GetPersonResponse, error) + DeletePerson(context.Context, *DeletePersonRequest) (*DeletePersonResponse, error) + ListPersons(context.Context, *ListPersonsRequest) (*ListPersonsResponse, error) CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) GetPayment(context.Context, *GetPaymentRequest) (*GetPaymentResponse, error) + DeletePayment(context.Context, *DeletePaymentRequest) (*DeletePaymentResponse, error) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) mustEmbedUnimplementedDfServer() @@ -244,12 +292,24 @@ func (UnimplementedDfServer) UpdateAccountPrivacy(context.Context, *UpdateAccoun func (UnimplementedDfServer) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePerson not implemented") } +func (UnimplementedDfServer) GetPerson(context.Context, *GetPersonRequest) (*GetPersonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPerson not implemented") +} +func (UnimplementedDfServer) DeletePerson(context.Context, *DeletePersonRequest) (*DeletePersonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePerson not implemented") +} +func (UnimplementedDfServer) ListPersons(context.Context, *ListPersonsRequest) (*ListPersonsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPersons not implemented") +} func (UnimplementedDfServer) CreatePayment(context.Context, *CreatePaymentRequest) (*CreatePaymentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePayment not implemented") } func (UnimplementedDfServer) GetPayment(context.Context, *GetPaymentRequest) (*GetPaymentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPayment not implemented") } +func (UnimplementedDfServer) DeletePayment(context.Context, *DeletePaymentRequest) (*DeletePaymentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePayment not implemented") +} func (UnimplementedDfServer) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListPayments not implemented") } @@ -449,6 +509,60 @@ func _Df_CreatePerson_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Df_GetPerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPersonRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).GetPerson(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_GetPerson_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).GetPerson(ctx, req.(*GetPersonRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Df_DeletePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePersonRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).DeletePerson(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_DeletePerson_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).DeletePerson(ctx, req.(*DeletePersonRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Df_ListPersons_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPersonsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).ListPersons(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_ListPersons_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).ListPersons(ctx, req.(*ListPersonsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Df_CreatePayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreatePaymentRequest) if err := dec(in); err != nil { @@ -485,6 +599,24 @@ func _Df_GetPayment_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Df_DeletePayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePaymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).DeletePayment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_DeletePayment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).DeletePayment(ctx, req.(*DeletePaymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Df_ListPayments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPaymentsRequest) if err := dec(in); err != nil { @@ -568,6 +700,18 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePerson", Handler: _Df_CreatePerson_Handler, }, + { + MethodName: "GetPerson", + Handler: _Df_GetPerson_Handler, + }, + { + MethodName: "DeletePerson", + Handler: _Df_DeletePerson_Handler, + }, + { + MethodName: "ListPersons", + Handler: _Df_ListPersons_Handler, + }, { MethodName: "CreatePayment", Handler: _Df_CreatePayment_Handler, @@ -576,6 +720,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetPayment", Handler: _Df_GetPayment_Handler, }, + { + MethodName: "DeletePayment", + Handler: _Df_DeletePayment_Handler, + }, { MethodName: "ListPayments", Handler: _Df_ListPayments_Handler, diff --git a/bff/proto/person.proto b/bff/proto/person.proto index 7764b2d..49921e1 100644 --- a/bff/proto/person.proto +++ b/bff/proto/person.proto @@ -14,7 +14,8 @@ message Person { }; example: "{\"id\": \"1\",\"email\": \"john.doe@example.com\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"phone\": \"\", \"street\": \"Death Star 2\", \"zip\": \"0815\", \"city\": \"New York\", \"country\": \"USA\", \"birthday\": \"1990-10-05T00:00:00Z\", \"privacy_accepted\": false, \"privacy_accepted_date\": \"0001-01-01T00:00:00Z\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; }; - int64 account_id = 1; + int64 id = 1; + int64 account_id = 2; string firstname = 3; string lastname = 4; string street = 5; diff --git a/bff/proto/rpc_delete_payment.proto b/bff/proto/rpc_delete_payment.proto new file mode 100644 index 0000000..f22fe79 --- /dev/null +++ b/bff/proto/rpc_delete_payment.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message DeletePaymentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Payment"; + description: "Delete a Payment"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\"}" + }; + int64 id = 1; +} + +message DeletePaymentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Payment Response"; + }; + example: "{\"id\": \"1\", \"deleted\": true}" + }; + int64 id = 1; + bool deleted = 2; +} \ No newline at end of file diff --git a/bff/proto/rpc_delete_person.proto b/bff/proto/rpc_delete_person.proto new file mode 100644 index 0000000..91082b1 --- /dev/null +++ b/bff/proto/rpc_delete_person.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message DeletePersonRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Person"; + description: "Delete a Person"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\"}" + }; + int64 id = 1; +} + +message DeletePersonResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Person Response"; + }; + example: "{\"id\": \"1\", \"deleted\": true}" + }; + int64 id = 1; + bool deleted = 2; +} \ No newline at end of file diff --git a/bff/proto/rpc_get_person.proto b/bff/proto/rpc_get_person.proto new file mode 100644 index 0000000..9fe31e4 --- /dev/null +++ b/bff/proto/rpc_get_person.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "person.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message GetPersonRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "GetPerson"; + description: "Get an Person by ID"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\" }"; + }; + int64 id = 1; +} + +message GetPersonResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "GetPerson Response"; + description: "Returns the Person"; + }; + }; + Person person = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_list_persons.proto b/bff/proto/rpc_list_persons.proto new file mode 100644 index 0000000..848af46 --- /dev/null +++ b/bff/proto/rpc_list_persons.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "person.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message ListPersonsRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListPersons"; + description: "Returns a List of Persons"; + required: [ + "account_id" + ]; + }; + example: "{\"account_id\": 1 }"; + }; + int64 account_id = 1; +} + +message ListPersonsResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListPersons Response"; + description: "Returns the Person"; + }; + }; + repeated Person persons = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index 897fed0..39d4120 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -11,8 +11,12 @@ import "rpc_create_payment.proto"; import "rpc_update_account.proto"; import "rpc_update_payment.proto"; import "rpc_get_account.proto"; +import "rpc_delete_person.proto"; +import "rpc_delete_payment.proto"; +import "rpc_get_person.proto"; import "rpc_get_payment.proto"; import "rpc_list_accounts.proto"; +import "rpc_list_persons.proto"; import "rpc_list_payments.proto"; import "rpc_list_sessions.proto"; import "rpc_block_session.proto"; @@ -168,6 +172,45 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc GetPerson (GetPersonRequest) returns (GetPersonResponse) { + option (google.api.http) = { + get: "/v1/persons/get_person/{id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc DeletePerson (DeletePersonRequest) returns (DeletePersonResponse) { + option (google.api.http) = { + delete: "/v1/persons/delete_person/{id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc ListPersons (ListPersonsRequest) returns (ListPersonsResponse) { + option (google.api.http) = { + get: "/v1/persons/list_persons/{account_id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse) { option (google.api.http) = { post: "/v1/payments/create_payment" @@ -195,9 +238,22 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse) { + option (google.api.http) = { + delete: "/v1/payments/delete_payment/{id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { option (google.api.http) = { - get: "/v1/payments/list_payments" + get: "/v1/payments/list_payments/{account_id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { From 8733dec355cb0f4e8d43c19814585aebdc7d88f9 Mon Sep 17 00:00:00 2001 From: itsscb Date: Mon, 9 Oct 2023 20:46:14 +0200 Subject: [PATCH 05/15] rf/changes IDs from int64 to uint64 --- bff/api/account.go | 8 +-- bff/api/account_test.go | 2 +- bff/db/mock/store.go | 36 +++++------ bff/db/sqlc/account.sql.go | 10 ++-- bff/db/sqlc/document.sql.go | 10 ++-- bff/db/sqlc/document_test.go | 4 +- bff/db/sqlc/mail.sql.go | 4 +- bff/db/sqlc/models.go | 16 ++--- bff/db/sqlc/payment.sql.go | 6 +- bff/db/sqlc/payment_test.go | 2 +- bff/db/sqlc/person.sql.go | 6 +- bff/db/sqlc/person_test.go | 2 +- bff/db/sqlc/provider.sql.go | 6 +- bff/db/sqlc/querier.go | 34 +++++------ bff/db/sqlc/return.sql.go | 6 +- bff/db/sqlc/return_test.go | 4 +- bff/db/sqlc/returnsLog.sql.go | 6 +- bff/db/sqlc/returnsLog_test.go | 4 +- bff/db/sqlc/store.go | 2 +- bff/db/sqlc/tx_create_person.go | 2 +- bff/db/sqlc/tx_delete_person.go | 4 +- bff/db/sqlc/tx_update_account.go | 2 +- bff/db/sqlc/tx_update_account_privacy.go | 2 +- bff/doc/swagger/df.swagger.json | 44 +++++++------- bff/gapi/converter.go | 4 +- bff/gapi/rpc_create_payment.go | 3 +- bff/gapi/rpc_create_person.go | 3 +- bff/gapi/rpc_delete_payment.go | 7 ++- bff/gapi/rpc_delete_person.go | 7 ++- bff/gapi/rpc_get_payment.go | 4 +- bff/gapi/rpc_get_person.go | 4 +- bff/gapi/rpc_list_accounts.go | 4 +- bff/gapi/rpc_list_payments.go | 4 +- bff/gapi/rpc_list_persons.go | 4 +- bff/gapi/rpc_update_payment.go | 4 +- bff/pb/account.pb.go | 6 +- bff/pb/payment.pb.go | 12 ++-- bff/pb/person.pb.go | 12 ++-- bff/pb/rpc_create_payment.pb.go | 69 +++++++++++----------- bff/pb/rpc_create_person.pb.go | 63 ++++++++++---------- bff/pb/rpc_delete_payment.pb.go | 6 +- bff/pb/rpc_delete_person.pb.go | 6 +- bff/pb/rpc_get_account.pb.go | 6 +- bff/pb/rpc_get_payment.pb.go | 6 +- bff/pb/rpc_get_person.pb.go | 6 +- bff/pb/rpc_list_accounts.pb.go | 45 +++++++------- bff/pb/rpc_list_payments.pb.go | 6 +- bff/pb/rpc_list_persons.pb.go | 6 +- bff/pb/rpc_list_sessions.pb.go | 6 +- bff/pb/rpc_update_account.pb.go | 6 +- bff/pb/rpc_update_account_privacy.pb.go | 8 +-- bff/pb/rpc_update_payment.pb.go | 6 +- bff/pb/service_df.pb.gw.go | 32 +++++----- bff/proto/account.proto | 2 +- bff/proto/payment.proto | 4 +- bff/proto/person.proto | 4 +- bff/proto/rpc_create_payment.proto | 3 +- bff/proto/rpc_create_person.proto | 3 +- bff/proto/rpc_delete_payment.proto | 2 +- bff/proto/rpc_delete_person.proto | 2 +- bff/proto/rpc_get_account.proto | 2 +- bff/proto/rpc_get_payment.proto | 2 +- bff/proto/rpc_get_person.proto | 2 +- bff/proto/rpc_list_accounts.proto | 7 ++- bff/proto/rpc_list_payments.proto | 2 +- bff/proto/rpc_list_persons.proto | 2 +- bff/proto/rpc_list_sessions.proto | 2 +- bff/proto/rpc_update_account.proto | 2 +- bff/proto/rpc_update_account_privacy.proto | 2 +- bff/proto/rpc_update_payment.proto | 2 +- bff/sqlc.yaml | 5 ++ bff/util/random.go | 4 +- 72 files changed, 328 insertions(+), 303 deletions(-) diff --git a/bff/api/account.go b/bff/api/account.go index cdb0d03..e9c9480 100644 --- a/bff/api/account.go +++ b/bff/api/account.go @@ -63,7 +63,7 @@ func (server *Server) createAccount(ctx *gin.Context) { } type getAccountRequest struct { - ID int64 `uri:"id" binding:"required,min=1" json:"id"` + ID uint64 `uri:"id" binding:"required,min=1" json:"id"` } func (server *Server) getAccount(ctx *gin.Context) { @@ -142,8 +142,8 @@ func (server *Server) listAccounts(ctx *gin.Context) { } type updateAccountPrivacyRequest struct { - ID int64 `binding:"required" json:"ID"` - PrivacyAccepted *bool `binding:"required" json:"privacy_accepted"` + ID uint64 `binding:"required" json:"ID"` + PrivacyAccepted *bool `binding:"required" json:"privacy_accepted"` } func (server *Server) updateAccountPrivacy(ctx *gin.Context) { @@ -180,7 +180,7 @@ func (server *Server) updateAccountPrivacy(ctx *gin.Context) { } type updateAccountRequest struct { - ID int64 `binding:"required" json:"ID"` + ID uint64 `binding:"required" json:"ID"` NewPassword string `json:"new_password"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` diff --git a/bff/api/account_test.go b/bff/api/account_test.go index d6993a0..42cb105 100644 --- a/bff/api/account_test.go +++ b/bff/api/account_test.go @@ -188,7 +188,7 @@ func TestGetAccountAPI(t *testing.T) { testCases := []struct { name string - accountID int64 + accountID uint64 setupAuth func(t *testing.T, request *http.Request, tokenMaker token.Maker) buildStubs func(store *mockdb.MockStore) checkResponse func(t *testing.T, recorder *httptest.ResponseRecorder) diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index a5c15ce..7bd70f9 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -249,7 +249,7 @@ func (mr *MockStoreMockRecorder) CreateSession(arg0, arg1 any) *gomock.Call { } // DeleteAccount mocks base method. -func (m *MockStore) DeleteAccount(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteAccount(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteAccount", arg0, arg1) ret0, _ := ret[0].(error) @@ -263,7 +263,7 @@ func (mr *MockStoreMockRecorder) DeleteAccount(arg0, arg1 any) *gomock.Call { } // DeleteDocument mocks base method. -func (m *MockStore) DeleteDocument(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteDocument(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteDocument", arg0, arg1) ret0, _ := ret[0].(error) @@ -277,7 +277,7 @@ func (mr *MockStoreMockRecorder) DeleteDocument(arg0, arg1 any) *gomock.Call { } // DeleteMail mocks base method. -func (m *MockStore) DeleteMail(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteMail(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteMail", arg0, arg1) ret0, _ := ret[0].(error) @@ -291,7 +291,7 @@ func (mr *MockStoreMockRecorder) DeleteMail(arg0, arg1 any) *gomock.Call { } // DeletePayment mocks base method. -func (m *MockStore) DeletePayment(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeletePayment(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeletePayment", arg0, arg1) ret0, _ := ret[0].(error) @@ -305,7 +305,7 @@ func (mr *MockStoreMockRecorder) DeletePayment(arg0, arg1 any) *gomock.Call { } // DeletePerson mocks base method. -func (m *MockStore) DeletePerson(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeletePerson(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeletePerson", arg0, arg1) ret0, _ := ret[0].(error) @@ -319,7 +319,7 @@ func (mr *MockStoreMockRecorder) DeletePerson(arg0, arg1 any) *gomock.Call { } // DeletePersonTx mocks base method. -func (m *MockStore) DeletePersonTx(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeletePersonTx(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeletePersonTx", arg0, arg1) ret0, _ := ret[0].(error) @@ -333,7 +333,7 @@ func (mr *MockStoreMockRecorder) DeletePersonTx(arg0, arg1 any) *gomock.Call { } // DeleteProvider mocks base method. -func (m *MockStore) DeleteProvider(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteProvider(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteProvider", arg0, arg1) ret0, _ := ret[0].(error) @@ -347,7 +347,7 @@ func (mr *MockStoreMockRecorder) DeleteProvider(arg0, arg1 any) *gomock.Call { } // DeleteReturn mocks base method. -func (m *MockStore) DeleteReturn(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteReturn(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteReturn", arg0, arg1) ret0, _ := ret[0].(error) @@ -361,7 +361,7 @@ func (mr *MockStoreMockRecorder) DeleteReturn(arg0, arg1 any) *gomock.Call { } // DeleteReturnsLog mocks base method. -func (m *MockStore) DeleteReturnsLog(arg0 context.Context, arg1 int64) error { +func (m *MockStore) DeleteReturnsLog(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteReturnsLog", arg0, arg1) ret0, _ := ret[0].(error) @@ -375,7 +375,7 @@ func (mr *MockStoreMockRecorder) DeleteReturnsLog(arg0, arg1 any) *gomock.Call { } // GetAccount mocks base method. -func (m *MockStore) GetAccount(arg0 context.Context, arg1 int64) (db.Account, error) { +func (m *MockStore) GetAccount(arg0 context.Context, arg1 uint64) (db.Account, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccount", arg0, arg1) ret0, _ := ret[0].(db.Account) @@ -405,7 +405,7 @@ func (mr *MockStoreMockRecorder) GetAccountByEmail(arg0, arg1 any) *gomock.Call } // GetAccountForUpdate mocks base method. -func (m *MockStore) GetAccountForUpdate(arg0 context.Context, arg1 int64) (db.Account, error) { +func (m *MockStore) GetAccountForUpdate(arg0 context.Context, arg1 uint64) (db.Account, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccountForUpdate", arg0, arg1) ret0, _ := ret[0].(db.Account) @@ -420,7 +420,7 @@ func (mr *MockStoreMockRecorder) GetAccountForUpdate(arg0, arg1 any) *gomock.Cal } // GetDocument mocks base method. -func (m *MockStore) GetDocument(arg0 context.Context, arg1 int64) (db.Document, error) { +func (m *MockStore) GetDocument(arg0 context.Context, arg1 uint64) (db.Document, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDocument", arg0, arg1) ret0, _ := ret[0].(db.Document) @@ -435,7 +435,7 @@ func (mr *MockStoreMockRecorder) GetDocument(arg0, arg1 any) *gomock.Call { } // GetMail mocks base method. -func (m *MockStore) GetMail(arg0 context.Context, arg1 int64) (db.Mail, error) { +func (m *MockStore) GetMail(arg0 context.Context, arg1 uint64) (db.Mail, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetMail", arg0, arg1) ret0, _ := ret[0].(db.Mail) @@ -450,7 +450,7 @@ func (mr *MockStoreMockRecorder) GetMail(arg0, arg1 any) *gomock.Call { } // GetPayment mocks base method. -func (m *MockStore) GetPayment(arg0 context.Context, arg1 int64) (db.Payment, error) { +func (m *MockStore) GetPayment(arg0 context.Context, arg1 uint64) (db.Payment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPayment", arg0, arg1) ret0, _ := ret[0].(db.Payment) @@ -465,7 +465,7 @@ func (mr *MockStoreMockRecorder) GetPayment(arg0, arg1 any) *gomock.Call { } // GetPerson mocks base method. -func (m *MockStore) GetPerson(arg0 context.Context, arg1 int64) (db.Person, error) { +func (m *MockStore) GetPerson(arg0 context.Context, arg1 uint64) (db.Person, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPerson", arg0, arg1) ret0, _ := ret[0].(db.Person) @@ -480,7 +480,7 @@ func (mr *MockStoreMockRecorder) GetPerson(arg0, arg1 any) *gomock.Call { } // GetProvider mocks base method. -func (m *MockStore) GetProvider(arg0 context.Context, arg1 int64) (db.Provider, error) { +func (m *MockStore) GetProvider(arg0 context.Context, arg1 uint64) (db.Provider, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetProvider", arg0, arg1) ret0, _ := ret[0].(db.Provider) @@ -495,7 +495,7 @@ func (mr *MockStoreMockRecorder) GetProvider(arg0, arg1 any) *gomock.Call { } // GetReturn mocks base method. -func (m *MockStore) GetReturn(arg0 context.Context, arg1 int64) (db.Return, error) { +func (m *MockStore) GetReturn(arg0 context.Context, arg1 uint64) (db.Return, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetReturn", arg0, arg1) ret0, _ := ret[0].(db.Return) @@ -525,7 +525,7 @@ func (mr *MockStoreMockRecorder) GetReturns(arg0, arg1 any) *gomock.Call { } // GetReturnsLog mocks base method. -func (m *MockStore) GetReturnsLog(arg0 context.Context, arg1 int64) (db.ReturnsLog, error) { +func (m *MockStore) GetReturnsLog(arg0 context.Context, arg1 uint64) (db.ReturnsLog, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetReturnsLog", arg0, arg1) ret0, _ := ret[0].(db.ReturnsLog) diff --git a/bff/db/sqlc/account.sql.go b/bff/db/sqlc/account.sql.go index 7edfb08..779da37 100644 --- a/bff/db/sqlc/account.sql.go +++ b/bff/db/sqlc/account.sql.go @@ -106,7 +106,7 @@ DELETE FROM accounts WHERE "id" = $1 ` -func (q *Queries) DeleteAccount(ctx context.Context, id int64) error { +func (q *Queries) DeleteAccount(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteAccount, id) return err } @@ -116,7 +116,7 @@ SELECT id, permission_level, passwordhash, firstname, lastname, birthday, privac WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetAccount(ctx context.Context, id int64) (Account, error) { +func (q *Queries) GetAccount(ctx context.Context, id uint64) (Account, error) { row := q.db.QueryRowContext(ctx, getAccount, id) var i Account err := row.Scan( @@ -179,7 +179,7 @@ WHERE "id" = $1 LIMIT 1 FOR NO KEY UPDATE ` -func (q *Queries) GetAccountForUpdate(ctx context.Context, id int64) (Account, error) { +func (q *Queries) GetAccountForUpdate(ctx context.Context, id uint64) (Account, error) { row := q.db.QueryRowContext(ctx, getAccountForUpdate, id) var i Account err := row.Scan( @@ -279,7 +279,7 @@ RETURNING id, permission_level, passwordhash, firstname, lastname, birthday, pri ` type UpdateAccountParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` Passwordhash sql.NullString `json:"passwordhash"` Firstname sql.NullString `json:"firstname"` @@ -347,7 +347,7 @@ type UpdateAccountPrivacyParams struct { PrivacyAccepted sql.NullBool `json:"privacy_accepted"` PrivacyAcceptedDate sql.NullTime `json:"privacy_accepted_date"` Changer string `json:"changer"` - ID int64 `json:"id"` + ID uint64 `json:"id"` } func (q *Queries) UpdateAccountPrivacy(ctx context.Context, arg UpdateAccountPrivacyParams) (Account, error) { diff --git a/bff/db/sqlc/document.sql.go b/bff/db/sqlc/document.sql.go index 558347e..e6b2825 100644 --- a/bff/db/sqlc/document.sql.go +++ b/bff/db/sqlc/document.sql.go @@ -123,7 +123,7 @@ DELETE FROM documents WHERE "id" = $1 ` -func (q *Queries) DeleteDocument(ctx context.Context, id int64) error { +func (q *Queries) DeleteDocument(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteDocument, id) return err } @@ -133,7 +133,7 @@ SELECT id, person_id, name, type, path, url, valid, valid_date, validated_by, ma WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetDocument(ctx context.Context, id int64) (Document, error) { +func (q *Queries) GetDocument(ctx context.Context, id uint64) (Document, error) { row := q.db.QueryRowContext(ctx, getDocument, id) var i Document err := row.Scan( @@ -168,7 +168,7 @@ RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, ` type InvalidateDocumentParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` } @@ -259,7 +259,7 @@ RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, ` type UpdateDocumentParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` PersonID sql.NullInt64 `json:"person_id"` Name sql.NullString `json:"name"` @@ -311,7 +311,7 @@ RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, ` type ValidateDocumentParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` ValidatedBy sql.NullString `json:"validated_by"` } diff --git a/bff/db/sqlc/document_test.go b/bff/db/sqlc/document_test.go index 45f7a22..95e05cf 100644 --- a/bff/db/sqlc/document_test.go +++ b/bff/db/sqlc/document_test.go @@ -19,7 +19,7 @@ func createRandomDocumentUpload(t *testing.T) Document { arg := CreateDocumentUploadParams{ PersonID: sql.NullInt64{ Valid: true, - Int64: person.ID, + Int64: int64(person.ID), }, Name: util.RandomString(20), Type: util.RandomString(5), @@ -57,7 +57,7 @@ func TestCreateDocumentMail(t *testing.T) { arg := CreateDocumentMailParams{ MailID: sql.NullInt64{ Valid: true, - Int64: mail.ID, + Int64: int64(mail.ID), }, Name: util.RandomString(20), Type: util.RandomString(5), diff --git a/bff/db/sqlc/mail.sql.go b/bff/db/sqlc/mail.sql.go index 1375ccf..b770e48 100644 --- a/bff/db/sqlc/mail.sql.go +++ b/bff/db/sqlc/mail.sql.go @@ -89,7 +89,7 @@ WHERE "id" = $1 // // WHERE "id" = $1 // RETURNING *; -func (q *Queries) DeleteMail(ctx context.Context, id int64) error { +func (q *Queries) DeleteMail(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteMail, id) return err } @@ -99,7 +99,7 @@ SELECT id, "from", "to", cc, timestamp, subject, body, creator, created, changer WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetMail(ctx context.Context, id int64) (Mail, error) { +func (q *Queries) GetMail(ctx context.Context, id uint64) (Mail, error) { row := q.db.QueryRowContext(ctx, getMail, id) var i Mail err := row.Scan( diff --git a/bff/db/sqlc/models.go b/bff/db/sqlc/models.go index f93a481..b27c817 100644 --- a/bff/db/sqlc/models.go +++ b/bff/db/sqlc/models.go @@ -12,7 +12,7 @@ import ( ) type Account struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` PermissionLevel int32 `json:"permission_level"` Passwordhash string `json:"passwordhash"` Firstname string `json:"firstname"` @@ -33,7 +33,7 @@ type Account struct { } type Document struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` PersonID sql.NullInt64 `json:"person_id"` Name string `json:"name"` Type string `json:"type"` @@ -50,7 +50,7 @@ type Document struct { } type Mail struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` From string `json:"from"` To []string `json:"to"` Cc []string `json:"cc"` @@ -64,7 +64,7 @@ type Mail struct { } type Payment struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` AccountID int64 `json:"account_id"` PaymentCategory string `json:"payment_category"` Bankname sql.NullString `json:"bankname"` @@ -81,7 +81,7 @@ type Payment struct { } type Person struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` AccountID int64 `json:"account_id"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` @@ -97,7 +97,7 @@ type Person struct { } type Provider struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` @@ -109,7 +109,7 @@ type Provider struct { } type Return struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` PersonID int64 `json:"person_id"` ProviderID int64 `json:"provider_id"` Name string `json:"name"` @@ -124,7 +124,7 @@ type Return struct { } type ReturnsLog struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` ReturnID int64 `json:"return_id"` MailID int64 `json:"mail_id"` Status sql.NullString `json:"status"` diff --git a/bff/db/sqlc/payment.sql.go b/bff/db/sqlc/payment.sql.go index 63b9ddc..c1eb584 100644 --- a/bff/db/sqlc/payment.sql.go +++ b/bff/db/sqlc/payment.sql.go @@ -81,7 +81,7 @@ DELETE FROM payments WHERE "id" = $1 ` -func (q *Queries) DeletePayment(ctx context.Context, id int64) error { +func (q *Queries) DeletePayment(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deletePayment, id) return err } @@ -91,7 +91,7 @@ SELECT id, account_id, payment_category, bankname, "IBAN", "BIC", paypal_account WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetPayment(ctx context.Context, id int64) (Payment, error) { +func (q *Queries) GetPayment(ctx context.Context, id uint64) (Payment, error) { row := q.db.QueryRowContext(ctx, getPayment, id) var i Payment err := row.Scan( @@ -176,7 +176,7 @@ RETURNING id, account_id, payment_category, bankname, "IBAN", "BIC", paypal_acco ` type UpdatePaymentParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` AccountID sql.NullInt64 `json:"account_id"` PaymentCategory sql.NullString `json:"payment_category"` diff --git a/bff/db/sqlc/payment_test.go b/bff/db/sqlc/payment_test.go index 3ed7b15..48db528 100644 --- a/bff/db/sqlc/payment_test.go +++ b/bff/db/sqlc/payment_test.go @@ -17,7 +17,7 @@ func createRandomPayment(t *testing.T) Payment { creator := util.RandomName() arg := CreatePaymentParams{ - AccountID: account.ID, + AccountID: int64(account.ID), PaymentCategory: util.RandomName(), Bankname: sql.NullString{ Valid: true, diff --git a/bff/db/sqlc/person.sql.go b/bff/db/sqlc/person.sql.go index 0520c8f..ddfd32e 100644 --- a/bff/db/sqlc/person.sql.go +++ b/bff/db/sqlc/person.sql.go @@ -78,7 +78,7 @@ DELETE FROM persons WHERE "id" = $1 ` -func (q *Queries) DeletePerson(ctx context.Context, id int64) error { +func (q *Queries) DeletePerson(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deletePerson, id) return err } @@ -88,7 +88,7 @@ SELECT id, account_id, firstname, lastname, birthday, city, zip, street, country WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetPerson(ctx context.Context, id int64) (Person, error) { +func (q *Queries) GetPerson(ctx context.Context, id uint64) (Person, error) { row := q.db.QueryRowContext(ctx, getPerson, id) var i Person err := row.Scan( @@ -211,7 +211,7 @@ RETURNING id, account_id, firstname, lastname, birthday, city, zip, street, coun ` type UpdatePersonParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` AccountID sql.NullInt64 `json:"account_id"` Firstname sql.NullString `json:"firstname"` diff --git a/bff/db/sqlc/person_test.go b/bff/db/sqlc/person_test.go index 8a1256c..85780e6 100644 --- a/bff/db/sqlc/person_test.go +++ b/bff/db/sqlc/person_test.go @@ -17,7 +17,7 @@ func createRandomPerson(t *testing.T) Person { creator := util.RandomName() arg := CreatePersonParams{ - AccountID: account.ID, + AccountID: int64(account.ID), Firstname: util.RandomName(), Lastname: util.RandomName(), Birthday: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC), diff --git a/bff/db/sqlc/provider.sql.go b/bff/db/sqlc/provider.sql.go index 43cb630..cbc92a8 100644 --- a/bff/db/sqlc/provider.sql.go +++ b/bff/db/sqlc/provider.sql.go @@ -61,7 +61,7 @@ DELETE FROM providers WHERE "id" = $1 ` -func (q *Queries) DeleteProvider(ctx context.Context, id int64) error { +func (q *Queries) DeleteProvider(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteProvider, id) return err } @@ -71,7 +71,7 @@ SELECT id, name, description, category, email, creator, created, changer, change WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetProvider(ctx context.Context, id int64) (Provider, error) { +func (q *Queries) GetProvider(ctx context.Context, id uint64) (Provider, error) { row := q.db.QueryRowContext(ctx, getProvider, id) var i Provider err := row.Scan( @@ -147,7 +147,7 @@ RETURNING id, name, description, category, email, creator, created, changer, cha ` type UpdateProviderParams struct { - ID int64 `json:"id"` + ID uint64 `json:"id"` Changer string `json:"changer"` Name sql.NullString `json:"name"` Description sql.NullString `json:"description"` diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index 0322bae..9f3282d 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -23,8 +23,8 @@ type Querier interface { CreateReturn(ctx context.Context, arg CreateReturnParams) (Return, error) CreateReturnsLog(ctx context.Context, arg CreateReturnsLogParams) (ReturnsLog, error) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) - DeleteAccount(ctx context.Context, id int64) error - DeleteDocument(ctx context.Context, id int64) error + DeleteAccount(ctx context.Context, id uint64) error + DeleteDocument(ctx context.Context, id uint64) error // -- name: UpdateMail :one // UPDATE mails // SET @@ -38,23 +38,23 @@ type Querier interface { // changed = now() // WHERE "id" = $1 // RETURNING *; - DeleteMail(ctx context.Context, id int64) error - DeletePayment(ctx context.Context, id int64) error - DeletePerson(ctx context.Context, id int64) error - DeleteProvider(ctx context.Context, id int64) error - DeleteReturn(ctx context.Context, id int64) error - DeleteReturnsLog(ctx context.Context, id int64) error - GetAccount(ctx context.Context, id int64) (Account, error) + DeleteMail(ctx context.Context, id uint64) error + DeletePayment(ctx context.Context, id uint64) error + DeletePerson(ctx context.Context, id uint64) error + DeleteProvider(ctx context.Context, id uint64) error + DeleteReturn(ctx context.Context, id uint64) error + DeleteReturnsLog(ctx context.Context, id uint64) error + GetAccount(ctx context.Context, id uint64) (Account, error) GetAccountByEmail(ctx context.Context, email string) (Account, error) - GetAccountForUpdate(ctx context.Context, id int64) (Account, error) - GetDocument(ctx context.Context, id int64) (Document, error) - GetMail(ctx context.Context, id int64) (Mail, error) - GetPayment(ctx context.Context, id int64) (Payment, error) - GetPerson(ctx context.Context, id int64) (Person, error) - GetProvider(ctx context.Context, id int64) (Provider, error) - GetReturn(ctx context.Context, id int64) (Return, error) + GetAccountForUpdate(ctx context.Context, id uint64) (Account, error) + GetDocument(ctx context.Context, id uint64) (Document, error) + GetMail(ctx context.Context, id uint64) (Mail, error) + GetPayment(ctx context.Context, id uint64) (Payment, error) + GetPerson(ctx context.Context, id uint64) (Person, error) + GetProvider(ctx context.Context, id uint64) (Provider, error) + GetReturn(ctx context.Context, id uint64) (Return, error) GetReturns(ctx context.Context, id int64) ([]Return, error) - GetReturnsLog(ctx context.Context, id int64) (ReturnsLog, error) + GetReturnsLog(ctx context.Context, id uint64) (ReturnsLog, error) GetSession(ctx context.Context, id uuid.UUID) (Session, error) InvalidateDocument(ctx context.Context, arg InvalidateDocumentParams) (Document, error) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error) diff --git a/bff/db/sqlc/return.sql.go b/bff/db/sqlc/return.sql.go index a483e88..915158d 100644 --- a/bff/db/sqlc/return.sql.go +++ b/bff/db/sqlc/return.sql.go @@ -116,7 +116,7 @@ DELETE FROM returns WHERE "id" = $1 ` -func (q *Queries) DeleteReturn(ctx context.Context, id int64) error { +func (q *Queries) DeleteReturn(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteReturn, id) return err } @@ -126,7 +126,7 @@ SELECT id, person_id, provider_id, name, description, category, email, status, c WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetReturn(ctx context.Context, id int64) (Return, error) { +func (q *Queries) GetReturn(ctx context.Context, id uint64) (Return, error) { row := q.db.QueryRowContext(ctx, getReturn, id) var i Return err := row.Scan( @@ -219,7 +219,7 @@ type UpdateReturnParams struct { Email sql.NullString `json:"email"` Status sql.NullString `json:"status"` Changer string `json:"changer"` - ID int64 `json:"id"` + ID uint64 `json:"id"` } func (q *Queries) UpdateReturn(ctx context.Context, arg UpdateReturnParams) (Return, error) { diff --git a/bff/db/sqlc/return_test.go b/bff/db/sqlc/return_test.go index 019caf1..a57bbee 100644 --- a/bff/db/sqlc/return_test.go +++ b/bff/db/sqlc/return_test.go @@ -18,8 +18,8 @@ func createRandomReturn(t *testing.T) Return { creator := util.RandomName() arg := CreateReturnParams{ - PersonID: person.ID, - ProviderID: provider.ID, + PersonID: int64(person.ID), + ProviderID: int64(provider.ID), Status: util.RandomString(7), Name: util.RandomName(), Description: util.RandomString(30), diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index 0793788..1fac37e 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -59,7 +59,7 @@ DELETE FROM "returnsLog" WHERE "id" = $1 ` -func (q *Queries) DeleteReturnsLog(ctx context.Context, id int64) error { +func (q *Queries) DeleteReturnsLog(ctx context.Context, id uint64) error { _, err := q.db.ExecContext(ctx, deleteReturnsLog, id) return err } @@ -69,7 +69,7 @@ SELECT id, return_id, mail_id, status, creator, created, changer, changed FROM " WHERE "id" = $1 LIMIT 1 ` -func (q *Queries) GetReturnsLog(ctx context.Context, id int64) (ReturnsLog, error) { +func (q *Queries) GetReturnsLog(ctx context.Context, id uint64) (ReturnsLog, error) { row := q.db.QueryRowContext(ctx, getReturnsLog, id) var i ReturnsLog err := row.Scan( @@ -146,7 +146,7 @@ type UpdateReturnsLogParams struct { ReturnID sql.NullInt64 `json:"return_id"` MailID sql.NullInt64 `json:"mail_id"` Status sql.NullString `json:"status"` - ID int64 `json:"id"` + ID uint64 `json:"id"` } func (q *Queries) UpdateReturnsLog(ctx context.Context, arg UpdateReturnsLogParams) (ReturnsLog, error) { diff --git a/bff/db/sqlc/returnsLog_test.go b/bff/db/sqlc/returnsLog_test.go index 30beeee..51bb91d 100644 --- a/bff/db/sqlc/returnsLog_test.go +++ b/bff/db/sqlc/returnsLog_test.go @@ -18,8 +18,8 @@ func createRandomReturnsLog(t *testing.T) ReturnsLog { creator := util.RandomName() arg := CreateReturnsLogParams{ - ReturnID: ret.ID, - MailID: mail.ID, + ReturnID: int64(ret.ID), + MailID: int64(mail.ID), Status: sql.NullString{ Valid: true, String: util.RandomString(7), diff --git a/bff/db/sqlc/store.go b/bff/db/sqlc/store.go index fc50379..cf1849a 100644 --- a/bff/db/sqlc/store.go +++ b/bff/db/sqlc/store.go @@ -12,7 +12,7 @@ type Store interface { UpdateAccountTx(ctx context.Context, arg UpdateAccountTxParams) (Account, error) UpdateAccountPrivacyTx(ctx context.Context, arg UpdateAccountPrivacyTxParams) (Account, error) CreatePersonTx(ctx context.Context, arg CreatePersonTxParams) (Person, error) - DeletePersonTx(ctx context.Context, id int64) error + DeletePersonTx(ctx context.Context, id uint64) error } // Store provides all functions to execute db queries and transactions diff --git a/bff/db/sqlc/tx_create_person.go b/bff/db/sqlc/tx_create_person.go index 6fabfa5..68ef658 100644 --- a/bff/db/sqlc/tx_create_person.go +++ b/bff/db/sqlc/tx_create_person.go @@ -35,7 +35,7 @@ func (store *SQLStore) CreatePersonTx(ctx context.Context, arg CreatePersonTxPar err = q.CloneProviders(ctx, CloneProvidersParams{ Creator: arg.Creator, - PersonID: result.Person.ID, + PersonID: int64(result.Person.ID), }) return err }) diff --git a/bff/db/sqlc/tx_delete_person.go b/bff/db/sqlc/tx_delete_person.go index 1aa2a8e..221e0be 100644 --- a/bff/db/sqlc/tx_delete_person.go +++ b/bff/db/sqlc/tx_delete_person.go @@ -4,10 +4,10 @@ import ( "context" ) -func (store *SQLStore) DeletePersonTx(ctx context.Context, id int64) error { +func (store *SQLStore) DeletePersonTx(ctx context.Context, id uint64) error { err := store.execTx(ctx, func(q *Queries) error { - // TODO: Add removal of db.returnsLog entries. + // TODO: #82 Add removal of db.returnsLog entries. err := q.DeletePerson(ctx, id) if err != nil { diff --git a/bff/db/sqlc/tx_update_account.go b/bff/db/sqlc/tx_update_account.go index 3132c9d..7feba5f 100644 --- a/bff/db/sqlc/tx_update_account.go +++ b/bff/db/sqlc/tx_update_account.go @@ -6,7 +6,7 @@ import ( ) type UpdateAccountTxParams struct { - ID int64 `json:"ID"` + ID uint64 `json:"ID"` Changer string `json:"changer"` Passwordhash sql.NullString `json:"passwordhash"` Firstname sql.NullString `json:"firstname"` diff --git a/bff/db/sqlc/tx_update_account_privacy.go b/bff/db/sqlc/tx_update_account_privacy.go index 64e054a..9eb02aa 100644 --- a/bff/db/sqlc/tx_update_account_privacy.go +++ b/bff/db/sqlc/tx_update_account_privacy.go @@ -7,7 +7,7 @@ import ( ) type UpdateAccountPrivacyTxParams struct { - ID int64 `json:"ID"` + ID uint64 `json:"ID"` Changer string `json:"changer"` PrivacyAccepted *bool `json:"privacy_accepted"` } diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index 490e23b..2eac134 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -82,7 +82,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -116,16 +116,16 @@ { "name": "pageId", "in": "query", - "required": false, + "required": true, "type": "integer", - "format": "int32" + "format": "int64" }, { "name": "pageSize", "in": "query", - "required": false, + "required": true, "type": "integer", - "format": "int32" + "format": "int64" } ], "tags": [ @@ -308,7 +308,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -344,7 +344,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -380,7 +380,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -492,7 +492,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -528,7 +528,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -564,7 +564,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -638,7 +638,7 @@ "in": "path", "required": true, "type": "string", - "format": "int64" + "format": "uint64" } ], "tags": [ @@ -709,7 +709,7 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "email": { "type": "string" @@ -897,7 +897,7 @@ "properties": { "accountId": { "type": "string", - "format": "int64" + "format": "uint64" }, "paymentCategory": { "type": "string" @@ -929,7 +929,6 @@ "required": [ "accountId", "paymentCategory", - "paymentSystem", "type" ] }, @@ -958,7 +957,7 @@ "properties": { "accountId": { "type": "string", - "format": "int64" + "format": "uint64" }, "firstname": { "type": "string" @@ -987,6 +986,7 @@ "description": "Create an Person", "title": "Create Person", "required": [ + "accountId", "firstname", "lastname", "street", @@ -1201,11 +1201,11 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "accountId": { "type": "string", - "format": "int64" + "format": "uint64" }, "paymentCategory": { "type": "string" @@ -1273,11 +1273,11 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "accountId": { "type": "string", - "format": "int64" + "format": "uint64" }, "firstname": { "type": "string" @@ -1444,7 +1444,7 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "email": { "type": "string" @@ -1508,7 +1508,7 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "paymentCategory": { "type": "string" diff --git a/bff/gapi/converter.go b/bff/gapi/converter.go index 4ed5af9..bc2a05e 100644 --- a/bff/gapi/converter.go +++ b/bff/gapi/converter.go @@ -31,7 +31,7 @@ func convertAccount(account db.Account) *pb.Account { func convertPerson(person db.Person) *pb.Person { return &pb.Person{ Id: person.ID, - AccountId: person.AccountID, + AccountId: uint64(person.AccountID), Firstname: person.Firstname, Lastname: person.Lastname, Street: person.Street, @@ -62,7 +62,7 @@ func convertSession(session db.Session) *pb.Session { func convertPayment(payment db.Payment) *pb.Payment { return &pb.Payment{ Id: payment.ID, - AccountId: payment.AccountID, + AccountId: uint64(payment.AccountID), PaymentCategory: payment.PaymentCategory, Bankname: &payment.Bankname.String, IBAN: &payment.IBAN.String, diff --git a/bff/gapi/rpc_create_payment.go b/bff/gapi/rpc_create_payment.go index ea36c1f..f1278b0 100644 --- a/bff/gapi/rpc_create_payment.go +++ b/bff/gapi/rpc_create_payment.go @@ -38,8 +38,9 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe } } + accountID := int64(req.GetAccountId()) arg := db.CreatePaymentParams{ - AccountID: req.GetAccountId(), + AccountID: accountID, PaymentCategory: req.GetPaymentCategory(), Bankname: sql.NullString{ Valid: req.GetBankname() != "", diff --git a/bff/gapi/rpc_create_person.go b/bff/gapi/rpc_create_person.go index ba0fee4..8985917 100644 --- a/bff/gapi/rpc_create_person.go +++ b/bff/gapi/rpc_create_person.go @@ -38,8 +38,9 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ } } + accountID := int64(req.GetAccountId()) arg := db.CreatePersonTxParams{ - AccountID: req.GetAccountId(), + AccountID: accountID, Firstname: req.GetFirstname(), Lastname: req.GetLastname(), Birthday: req.GetBirthday().AsTime(), diff --git a/bff/gapi/rpc_delete_payment.go b/bff/gapi/rpc_delete_payment.go index 4077a54..f635ea8 100644 --- a/bff/gapi/rpc_delete_payment.go +++ b/bff/gapi/rpc_delete_payment.go @@ -44,7 +44,10 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe return nil, status.Errorf(codes.Internal, "failed to get payment") } - if payment.AccountID != account.ID { + paymentID := int64(req.GetId()) + accountID := int64(account.ID) + + if payment.AccountID != accountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "payment not found") } @@ -57,7 +60,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe } rsp := &pb.DeletePaymentResponse{ - Id: req.GetId(), + Id: paymentID, Deleted: true, } return rsp, nil diff --git a/bff/gapi/rpc_delete_person.go b/bff/gapi/rpc_delete_person.go index 8f11972..968f62e 100644 --- a/bff/gapi/rpc_delete_person.go +++ b/bff/gapi/rpc_delete_person.go @@ -44,7 +44,10 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ return nil, status.Errorf(codes.Internal, "failed to get person") } - if person.AccountID != account.ID { + personID := int64(person.ID) + accountID := int64(account.ID) + + if person.AccountID != accountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "person not found") } @@ -57,7 +60,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ } rsp := &pb.DeletePersonResponse{ - Id: req.GetId(), + Id: personID, Deleted: true, } return rsp, nil diff --git a/bff/gapi/rpc_get_payment.go b/bff/gapi/rpc_get_payment.go index ed72d10..08cf18c 100644 --- a/bff/gapi/rpc_get_payment.go +++ b/bff/gapi/rpc_get_payment.go @@ -44,7 +44,9 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) return nil, status.Error(codes.NotFound, "failed to get payments") } - if account.ID != payment.AccountID { + accountID := int64(account.ID) + + if accountID != payment.AccountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } diff --git a/bff/gapi/rpc_get_person.go b/bff/gapi/rpc_get_person.go index 7687a39..6439a90 100644 --- a/bff/gapi/rpc_get_person.go +++ b/bff/gapi/rpc_get_person.go @@ -44,7 +44,9 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( return nil, status.Error(codes.NotFound, "failed to get persons") } - if account.ID != person.AccountID { + accountID := int64(account.ID) + + if accountID != person.AccountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } diff --git a/bff/gapi/rpc_list_accounts.go b/bff/gapi/rpc_list_accounts.go index b3dc934..bf38c03 100644 --- a/bff/gapi/rpc_list_accounts.go +++ b/bff/gapi/rpc_list_accounts.go @@ -24,8 +24,8 @@ func (server *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequ } arg := db.ListAccountsParams{ - Limit: req.GetPageSize(), - Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Limit: int32(req.GetPageSize()), + Offset: int32((req.GetPageId() - 1) * req.GetPageSize()), } dbAccounts, err := server.store.ListAccounts(ctx, arg) diff --git a/bff/gapi/rpc_list_payments.go b/bff/gapi/rpc_list_payments.go index 6f2ce92..124987f 100644 --- a/bff/gapi/rpc_list_payments.go +++ b/bff/gapi/rpc_list_payments.go @@ -42,7 +42,9 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ } } - dbPayments, err := server.store.ListPayments(ctx, req.GetAccountId()) + accountID := int64(account.ID) + + dbPayments, err := server.store.ListPayments(ctx, accountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") diff --git a/bff/gapi/rpc_list_persons.go b/bff/gapi/rpc_list_persons.go index ef4ffa4..129fc9b 100644 --- a/bff/gapi/rpc_list_persons.go +++ b/bff/gapi/rpc_list_persons.go @@ -42,7 +42,9 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques } } - dbPersons, err := server.store.ListPersons(ctx, req.GetAccountId()) + accountID := int64(account.ID) + + dbPersons, err := server.store.ListPersons(ctx, accountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") diff --git a/bff/gapi/rpc_update_payment.go b/bff/gapi/rpc_update_payment.go index 3856389..b892d81 100644 --- a/bff/gapi/rpc_update_payment.go +++ b/bff/gapi/rpc_update_payment.go @@ -46,7 +46,9 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe return nil, status.Error(codes.Internal, "failed to get payment") } - if dbPayment.AccountID != account.ID { + accountID := int64(account.ID) + + if dbPayment.AccountID != accountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "payment not found") } diff --git a/bff/pb/account.pb.go b/bff/pb/account.pb.go index 16cafdb..caca720 100644 --- a/bff/pb/account.pb.go +++ b/bff/pb/account.pb.go @@ -27,7 +27,7 @@ type Account struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` Firstname string `protobuf:"bytes,3,opt,name=firstname,proto3" json:"firstname,omitempty"` Lastname string `protobuf:"bytes,4,opt,name=lastname,proto3" json:"lastname,omitempty"` @@ -78,7 +78,7 @@ func (*Account) Descriptor() ([]byte, []int) { return file_account_proto_rawDescGZIP(), []int{0} } -func (x *Account) GetId() int64 { +func (x *Account) GetId() uint64 { if x != nil { return x.Id } @@ -207,7 +207,7 @@ var file_account_proto_rawDesc = []byte{ 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x09, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, diff --git a/bff/pb/payment.pb.go b/bff/pb/payment.pb.go index 481beee..b79155c 100644 --- a/bff/pb/payment.pb.go +++ b/bff/pb/payment.pb.go @@ -27,8 +27,8 @@ type Payment struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AccountId int64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` PaymentCategory string `protobuf:"bytes,3,opt,name=payment_category,json=paymentCategory,proto3" json:"payment_category,omitempty"` Bankname *string `protobuf:"bytes,4,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` IBAN *string `protobuf:"bytes,5,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` @@ -75,14 +75,14 @@ func (*Payment) Descriptor() ([]byte, []int) { return file_payment_proto_rawDescGZIP(), []int{0} } -func (x *Payment) GetId() int64 { +func (x *Payment) GetId() uint64 { if x != nil { return x.Id } return 0 } -func (x *Payment) GetAccountId() int64 { +func (x *Payment) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -183,9 +183,9 @@ var file_payment_proto_rawDesc = []byte{ 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x07, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x08, 0x62, 0x61, diff --git a/bff/pb/person.pb.go b/bff/pb/person.pb.go index cc6ca1e..9204ed5 100644 --- a/bff/pb/person.pb.go +++ b/bff/pb/person.pb.go @@ -27,8 +27,8 @@ type Person struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AccountId int64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` Firstname string `protobuf:"bytes,3,opt,name=firstname,proto3" json:"firstname,omitempty"` Lastname string `protobuf:"bytes,4,opt,name=lastname,proto3" json:"lastname,omitempty"` Street string `protobuf:"bytes,5,opt,name=street,proto3" json:"street,omitempty"` @@ -74,14 +74,14 @@ func (*Person) Descriptor() ([]byte, []int) { return file_person_proto_rawDescGZIP(), []int{0} } -func (x *Person) GetId() int64 { +func (x *Person) GetId() uint64 { if x != nil { return x.Id } return 0 } -func (x *Person) GetAccountId() int64 { +func (x *Person) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -175,9 +175,9 @@ var file_person_proto_rawDesc = []byte{ 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x07, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, + 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, diff --git a/bff/pb/rpc_create_payment.pb.go b/bff/pb/rpc_create_payment.pb.go index 7ce5d6f..1828fa6 100644 --- a/bff/pb/rpc_create_payment.pb.go +++ b/bff/pb/rpc_create_payment.pb.go @@ -26,7 +26,7 @@ type CreatePaymentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccountId uint64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` PaymentCategory string `protobuf:"bytes,2,opt,name=payment_category,json=paymentCategory,proto3" json:"payment_category,omitempty"` Bankname *string `protobuf:"bytes,3,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` IBAN *string `protobuf:"bytes,4,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` @@ -69,7 +69,7 @@ func (*CreatePaymentRequest) Descriptor() ([]byte, []int) { return file_rpc_create_payment_proto_rawDescGZIP(), []int{0} } -func (x *CreatePaymentRequest) GetAccountId() int64 { +func (x *CreatePaymentRequest) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -187,10 +187,10 @@ var file_rpc_create_payment_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x05, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x05, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, @@ -208,40 +208,39 @@ var file_rpc_create_payment_proto_rawDesc = []byte{ 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a, - 0xaa, 0x02, 0x92, 0x41, 0xa6, 0x02, 0x0a, 0x5b, 0x2a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x99, 0x02, 0x92, 0x41, 0x95, 0x02, 0x0a, 0x4a, 0x2a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x0e, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0xd2, 0x01, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x32, 0xc6, 0x01, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x54, - 0x42, 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, - 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, - 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, - 0x64, 0x22, 0x3a, 0x20, 0x22, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x69, 0x73, 0x2d, 0x61, 0x2d, 0x70, - 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2d, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, - 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x22, 0x2c, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, - 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7d, 0x42, 0x0b, 0x0a, 0x09, - 0x5f, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x49, 0x42, - 0x41, 0x4e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x42, 0x49, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, - 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, - 0x0a, 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x78, - 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x1b, 0x52, 0x65, 0x74, - 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, - 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x32, 0xc6, 0x01, 0x7b, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, + 0x44, 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, + 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x6a, + 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x22, 0x3a, 0x20, 0x22, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x69, 0x73, 0x2d, 0x61, 0x2d, 0x70, 0x61, + 0x79, 0x70, 0x61, 0x6c, 0x2d, 0x69, 0x64, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, + 0x3a, 0x20, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, + 0x2c, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x42, 0x44, 0x3a, 0x20, + 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7d, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x49, 0x42, 0x41, + 0x4e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x42, 0x49, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, + 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x78, 0x0a, + 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x1b, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/rpc_create_person.pb.go b/bff/pb/rpc_create_person.pb.go index 38926f5..793f1c1 100644 --- a/bff/pb/rpc_create_person.pb.go +++ b/bff/pb/rpc_create_person.pb.go @@ -27,7 +27,7 @@ type CreatePersonRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccountId uint64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` Firstname string `protobuf:"bytes,2,opt,name=firstname,proto3" json:"firstname,omitempty"` Lastname string `protobuf:"bytes,3,opt,name=lastname,proto3" json:"lastname,omitempty"` Street string `protobuf:"bytes,4,opt,name=street,proto3" json:"street,omitempty"` @@ -69,7 +69,7 @@ func (*CreatePersonRequest) Descriptor() ([]byte, []int) { return file_rpc_create_person_proto_rawDescGZIP(), []int{0} } -func (x *CreatePersonRequest) GetAccountId() int64 { +func (x *CreatePersonRequest) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -182,10 +182,10 @@ var file_rpc_create_person_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x04, 0x0a, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x04, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, @@ -200,34 +200,35 @@ var file_rpc_create_person_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, - 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x3a, 0x9c, 0x02, 0x92, 0x41, 0x98, - 0x02, 0x0a, 0x63, 0x2a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, + 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x3a, 0xa9, 0x02, 0x92, 0x41, 0xa5, + 0x02, 0x0a, 0x70, 0x2a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0xd2, 0x01, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, - 0xd2, 0x01, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x06, 0x73, 0x74, - 0x72, 0x65, 0x65, 0x74, 0xd2, 0x01, 0x04, 0x63, 0x69, 0x74, 0x79, 0xd2, 0x01, 0x03, 0x7a, 0x69, - 0x70, 0xd2, 0x01, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0xd2, 0x01, 0x08, 0x62, 0x69, - 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x32, 0xb0, 0x01, 0x7b, 0x20, 0x22, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x66, - 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x4a, 0x6f, 0x68, 0x6e, - 0x22, 0x2c, 0x20, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, - 0x44, 0x6f, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, 0x3a, 0x20, - 0x22, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x20, 0x31, 0x22, 0x2c, - 0x20, 0x22, 0x7a, 0x69, 0x70, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x38, 0x31, 0x35, 0x22, 0x2c, 0x20, - 0x22, 0x63, 0x69, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x4e, 0x65, 0x77, 0x20, 0x59, 0x6f, 0x72, - 0x6b, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, - 0x55, 0x53, 0x41, 0x22, 0x2c, 0x20, 0x22, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, - 0x3a, 0x20, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, - 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x7d, 0x22, 0x72, 0x0a, 0x14, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x27, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0x92, - 0x41, 0x00, 0x52, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, - 0x2c, 0x2a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x19, 0x5a, - 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, - 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x73, 0x6f, 0x6e, 0xd2, 0x01, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0xd2, 0x01, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x08, + 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x06, 0x73, 0x74, 0x72, 0x65, 0x65, + 0x74, 0xd2, 0x01, 0x04, 0x63, 0x69, 0x74, 0x79, 0xd2, 0x01, 0x03, 0x7a, 0x69, 0x70, 0xd2, 0x01, + 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0xd2, 0x01, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, + 0x64, 0x61, 0x79, 0x32, 0xb0, 0x01, 0x7b, 0x20, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x66, 0x69, 0x72, 0x73, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x4a, 0x6f, 0x68, 0x6e, 0x22, 0x2c, 0x20, + 0x22, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x6f, 0x65, + 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x4d, 0x61, + 0x69, 0x6e, 0x20, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x20, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x7a, + 0x69, 0x70, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x38, 0x31, 0x35, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x69, + 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x4e, 0x65, 0x77, 0x20, 0x59, 0x6f, 0x72, 0x6b, 0x22, 0x2c, + 0x20, 0x22, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x55, 0x53, 0x41, + 0x22, 0x2c, 0x20, 0x22, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x3a, 0x20, 0x22, + 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, + 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x7d, 0x22, 0x72, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, + 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, + 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, 0x0e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x1a, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, + 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/rpc_delete_payment.pb.go b/bff/pb/rpc_delete_payment.pb.go index 7d0d41a..2ca05c5 100644 --- a/bff/pb/rpc_delete_payment.pb.go +++ b/bff/pb/rpc_delete_payment.pb.go @@ -26,7 +26,7 @@ type DeletePaymentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *DeletePaymentRequest) Reset() { @@ -61,7 +61,7 @@ func (*DeletePaymentRequest) Descriptor() ([]byte, []int) { return file_rpc_delete_payment_proto_rawDescGZIP(), []int{0} } -func (x *DeletePaymentRequest) GetId() int64 { +func (x *DeletePaymentRequest) GetId() uint64 { if x != nil { return x.Id } @@ -133,7 +133,7 @@ var file_rpc_delete_payment_proto_rawDesc = []byte{ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x61, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x39, 0x92, 0x41, 0x36, 0x0a, 0x27, 0x2a, 0x0e, 0x44, + 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x39, 0x92, 0x41, 0x36, 0x0a, 0x27, 0x2a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, diff --git a/bff/pb/rpc_delete_person.pb.go b/bff/pb/rpc_delete_person.pb.go index 0fa913c..15abbbd 100644 --- a/bff/pb/rpc_delete_person.pb.go +++ b/bff/pb/rpc_delete_person.pb.go @@ -26,7 +26,7 @@ type DeletePersonRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *DeletePersonRequest) Reset() { @@ -61,7 +61,7 @@ func (*DeletePersonRequest) Descriptor() ([]byte, []int) { return file_rpc_delete_person_proto_rawDescGZIP(), []int{0} } -func (x *DeletePersonRequest) GetId() int64 { +func (x *DeletePersonRequest) GetId() uint64 { if x != nil { return x.Id } @@ -132,7 +132,7 @@ var file_rpc_delete_person_proto_rawDesc = []byte{ 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x37, 0x92, 0x41, 0x34, 0x0a, 0x25, 0x2a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0xd2, 0x01, 0x02, 0x69, 0x64, diff --git a/bff/pb/rpc_get_account.pb.go b/bff/pb/rpc_get_account.pb.go index 98ff6c2..d1ec158 100644 --- a/bff/pb/rpc_get_account.pb.go +++ b/bff/pb/rpc_get_account.pb.go @@ -26,7 +26,7 @@ type GetAccountRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *GetAccountRequest) Reset() { @@ -61,7 +61,7 @@ func (*GetAccountRequest) Descriptor() ([]byte, []int) { return file_rpc_get_account_proto_rawDescGZIP(), []int{0} } -func (x *GetAccountRequest) GetId() int64 { +func (x *GetAccountRequest) GetId() uint64 { if x != nil { return x.Id } @@ -125,7 +125,7 @@ var file_rpc_get_account_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x3a, 0x92, 0x41, 0x37, 0x0a, 0x27, 0x2a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x14, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0c, 0x7b, diff --git a/bff/pb/rpc_get_payment.pb.go b/bff/pb/rpc_get_payment.pb.go index 81f676f..0588f72 100644 --- a/bff/pb/rpc_get_payment.pb.go +++ b/bff/pb/rpc_get_payment.pb.go @@ -26,7 +26,7 @@ type GetPaymentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *GetPaymentRequest) Reset() { @@ -61,7 +61,7 @@ func (*GetPaymentRequest) Descriptor() ([]byte, []int) { return file_rpc_get_payment_proto_rawDescGZIP(), []int{0} } -func (x *GetPaymentRequest) GetId() int64 { +func (x *GetPaymentRequest) GetId() uint64 { if x != nil { return x.Id } @@ -125,7 +125,7 @@ var file_rpc_get_payment_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x3a, 0x92, 0x41, 0x37, 0x0a, 0x27, 0x2a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x14, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0c, 0x7b, diff --git a/bff/pb/rpc_get_person.pb.go b/bff/pb/rpc_get_person.pb.go index 80362e3..6757da0 100644 --- a/bff/pb/rpc_get_person.pb.go +++ b/bff/pb/rpc_get_person.pb.go @@ -26,7 +26,7 @@ type GetPersonRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *GetPersonRequest) Reset() { @@ -61,7 +61,7 @@ func (*GetPersonRequest) Descriptor() ([]byte, []int) { return file_rpc_get_person_proto_rawDescGZIP(), []int{0} } -func (x *GetPersonRequest) GetId() int64 { +func (x *GetPersonRequest) GetId() uint64 { if x != nil { return x.Id } @@ -125,7 +125,7 @@ var file_rpc_get_person_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x38, 0x92, 0x41, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x38, 0x92, 0x41, 0x35, 0x0a, 0x25, 0x2a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x13, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0c, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, diff --git a/bff/pb/rpc_list_accounts.pb.go b/bff/pb/rpc_list_accounts.pb.go index 39982d7..f75815b 100644 --- a/bff/pb/rpc_list_accounts.pb.go +++ b/bff/pb/rpc_list_accounts.pb.go @@ -26,8 +26,8 @@ type ListAccountsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageId uint32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` } func (x *ListAccountsRequest) Reset() { @@ -62,14 +62,14 @@ func (*ListAccountsRequest) Descriptor() ([]byte, []int) { return file_rpc_list_accounts_proto_rawDescGZIP(), []int{0} } -func (x *ListAccountsRequest) GetPageId() int32 { +func (x *ListAccountsRequest) GetPageId() uint32 { if x != nil { return x.PageId } return 0 } -func (x *ListAccountsRequest) GetPageSize() int32 { +func (x *ListAccountsRequest) GetPageSize() uint32 { if x != nil { return x.PageSize } @@ -131,27 +131,28 @@ var file_rpc_list_accounts_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x56, 0x92, 0x41, 0x53, 0x0a, - 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x32, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x67, 0x92, 0x41, 0x64, 0x0a, + 0x40, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, - 0x6f, 0x66, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x02, 0x69, 0x64, - 0x32, 0x20, 0x7b, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x2c, - 0x20, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x20, 0x31, 0x30, - 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, - 0x62, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, 0x08, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, - 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x66, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x07, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x32, 0x20, 0x7b, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, + 0x2c, 0x20, 0x22, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x20, 0x31, + 0x30, 0x20, 0x7d, 0x22, 0x77, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x70, 0x62, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, + 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, + 0x2a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x13, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x19, 0x5a, 0x17, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, + 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/rpc_list_payments.pb.go b/bff/pb/rpc_list_payments.pb.go index efe4992..4ddc2c1 100644 --- a/bff/pb/rpc_list_payments.pb.go +++ b/bff/pb/rpc_list_payments.pb.go @@ -26,7 +26,7 @@ type ListPaymentsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccountId uint64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *ListPaymentsRequest) Reset() { @@ -61,7 +61,7 @@ func (*ListPaymentsRequest) Descriptor() ([]byte, []int) { return file_rpc_list_payments_proto_rawDescGZIP(), []int{0} } -func (x *ListPaymentsRequest) GetAccountId() int64 { +func (x *ListPaymentsRequest) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -126,7 +126,7 @@ var file_rpc_list_payments_proto_rawDesc = []byte{ 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x50, 0x92, 0x41, 0x4d, 0x0a, 0x37, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x61, 0x79, 0x6d, diff --git a/bff/pb/rpc_list_persons.pb.go b/bff/pb/rpc_list_persons.pb.go index b579cbf..c3afc14 100644 --- a/bff/pb/rpc_list_persons.pb.go +++ b/bff/pb/rpc_list_persons.pb.go @@ -26,7 +26,7 @@ type ListPersonsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccountId uint64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *ListPersonsRequest) Reset() { @@ -61,7 +61,7 @@ func (*ListPersonsRequest) Descriptor() ([]byte, []int) { return file_rpc_list_persons_proto_rawDescGZIP(), []int{0} } -func (x *ListPersonsRequest) GetAccountId() int64 { +func (x *ListPersonsRequest) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -126,7 +126,7 @@ var file_rpc_list_persons_proto_rawDesc = []byte{ 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x4e, 0x92, 0x41, 0x4b, 0x0a, 0x35, 0x2a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x32, 0x19, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0xd2, diff --git a/bff/pb/rpc_list_sessions.pb.go b/bff/pb/rpc_list_sessions.pb.go index 6be8491..187682d 100644 --- a/bff/pb/rpc_list_sessions.pb.go +++ b/bff/pb/rpc_list_sessions.pb.go @@ -26,7 +26,7 @@ type ListSessionsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccountId uint64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *ListSessionsRequest) Reset() { @@ -61,7 +61,7 @@ func (*ListSessionsRequest) Descriptor() ([]byte, []int) { return file_rpc_list_sessions_proto_rawDescGZIP(), []int{0} } -func (x *ListSessionsRequest) GetAccountId() int64 { +func (x *ListSessionsRequest) GetAccountId() uint64 { if x != nil { return x.AccountId } @@ -126,7 +126,7 @@ var file_rpc_list_sessions_proto_rawDesc = []byte{ 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, 0xa2, 0x02, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x52, 0x92, 0x41, 0x4f, 0x0a, 0x37, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x1a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, diff --git a/bff/pb/rpc_update_account.pb.go b/bff/pb/rpc_update_account.pb.go index 872f02b..023c8ff 100644 --- a/bff/pb/rpc_update_account.pb.go +++ b/bff/pb/rpc_update_account.pb.go @@ -27,7 +27,7 @@ type UpdateAccountRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"` Password *string `protobuf:"bytes,3,opt,name=password,proto3,oneof" json:"password,omitempty"` Firstname *string `protobuf:"bytes,4,opt,name=firstname,proto3,oneof" json:"firstname,omitempty"` @@ -72,7 +72,7 @@ func (*UpdateAccountRequest) Descriptor() ([]byte, []int) { return file_rpc_update_account_proto_rawDescGZIP(), []int{0} } -func (x *UpdateAccountRequest) GetId() int64 { +func (x *UpdateAccountRequest) GetId() uint64 { if x != nil { return x.Id } @@ -209,7 +209,7 @@ var file_rpc_update_account_proto_rawDesc = []byte{ 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x04, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, diff --git a/bff/pb/rpc_update_account_privacy.pb.go b/bff/pb/rpc_update_account_privacy.pb.go index 14b3f05..7383e11 100644 --- a/bff/pb/rpc_update_account_privacy.pb.go +++ b/bff/pb/rpc_update_account_privacy.pb.go @@ -26,8 +26,8 @@ type UpdateAccountPrivacyRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PrivacyAccepted *bool `protobuf:"varint,2,opt,name=privacy_accepted,json=privacyAccepted,proto3,oneof" json:"privacy_accepted,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PrivacyAccepted *bool `protobuf:"varint,2,opt,name=privacy_accepted,json=privacyAccepted,proto3,oneof" json:"privacy_accepted,omitempty"` } func (x *UpdateAccountPrivacyRequest) Reset() { @@ -62,7 +62,7 @@ func (*UpdateAccountPrivacyRequest) Descriptor() ([]byte, []int) { return file_rpc_update_account_privacy_proto_rawDescGZIP(), []int{0} } -func (x *UpdateAccountPrivacyRequest) GetId() int64 { +func (x *UpdateAccountPrivacyRequest) GetId() uint64 { if x != nil { return x.Id } @@ -135,7 +135,7 @@ var file_rpc_update_account_privacy_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x02, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, 0xa2, 0x02, 0x05, 0x69, 0x6e, 0x74, 0x36, + 0x04, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, 0xa2, 0x02, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0x92, 0x41, 0x07, 0x4a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x70, diff --git a/bff/pb/rpc_update_payment.pb.go b/bff/pb/rpc_update_payment.pb.go index d8480e7..74230f0 100644 --- a/bff/pb/rpc_update_payment.pb.go +++ b/bff/pb/rpc_update_payment.pb.go @@ -26,7 +26,7 @@ type UpdatePaymentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` PaymentCategory *string `protobuf:"bytes,2,opt,name=payment_category,json=paymentCategory,proto3,oneof" json:"payment_category,omitempty"` Bankname *string `protobuf:"bytes,3,opt,name=bankname,proto3,oneof" json:"bankname,omitempty"` IBAN *string `protobuf:"bytes,4,opt,name=IBAN,proto3,oneof" json:"IBAN,omitempty"` @@ -69,7 +69,7 @@ func (*UpdatePaymentRequest) Descriptor() ([]byte, []int) { return file_rpc_update_payment_proto_rawDescGZIP(), []int{0} } -func (x *UpdatePaymentRequest) GetId() int64 { +func (x *UpdatePaymentRequest) GetId() uint64 { if x != nil { return x.Id } @@ -190,7 +190,7 @@ var file_rpc_update_payment_proto_rawDesc = []byte{ 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x05, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x62, 0x61, 0x6e, 0x6b, 0x6e, 0x61, diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 0de93ce..37cf0ae 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -115,7 +115,7 @@ func request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } @@ -141,7 +141,7 @@ func local_request_Df_ListSessions_0(ctx context.Context, marshaler runtime.Mars return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } @@ -201,7 +201,7 @@ func request_Df_GetAccount_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -227,7 +227,7 @@ func local_request_Df_GetAccount_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -425,7 +425,7 @@ func request_Df_GetPerson_0(ctx context.Context, marshaler runtime.Marshaler, cl return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -451,7 +451,7 @@ func local_request_Df_GetPerson_0(ctx context.Context, marshaler runtime.Marshal return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -477,7 +477,7 @@ func request_Df_DeletePerson_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -503,7 +503,7 @@ func local_request_Df_DeletePerson_0(ctx context.Context, marshaler runtime.Mars return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -529,7 +529,7 @@ func request_Df_ListPersons_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } @@ -555,7 +555,7 @@ func local_request_Df_ListPersons_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } @@ -615,7 +615,7 @@ func request_Df_GetPayment_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -641,7 +641,7 @@ func local_request_Df_GetPayment_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -667,7 +667,7 @@ func request_Df_DeletePayment_0(ctx context.Context, marshaler runtime.Marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -693,7 +693,7 @@ func local_request_Df_DeletePayment_0(ctx context.Context, marshaler runtime.Mar return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Int64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } @@ -719,7 +719,7 @@ func request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } @@ -745,7 +745,7 @@ func local_request_Df_ListPayments_0(ctx context.Context, marshaler runtime.Mars return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account_id") } - protoReq.AccountId, err = runtime.Int64(val) + protoReq.AccountId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "account_id", err) } diff --git a/bff/proto/account.proto b/bff/proto/account.proto index 6f45c1d..4ceff8d 100644 --- a/bff/proto/account.proto +++ b/bff/proto/account.proto @@ -14,7 +14,7 @@ message Account { }; example: "{\"id\": \"1\",\"email\": \"john.doe@example.com\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"phone\": \"\", \"street\": \"Death Star 2\", \"zip\": \"0815\", \"city\": \"New York\", \"country\": \"USA\", \"birthday\": \"1990-10-05T00:00:00Z\", \"privacy_accepted\": false, \"privacy_accepted_date\": \"0001-01-01T00:00:00Z\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; }; - int64 id = 1; + uint64 id = 1; string email = 2; string firstname = 3; string lastname = 4; diff --git a/bff/proto/payment.proto b/bff/proto/payment.proto index 93c16a6..8d3be92 100644 --- a/bff/proto/payment.proto +++ b/bff/proto/payment.proto @@ -14,8 +14,8 @@ message Payment { }; example: "{\"id\": \"1\",\"account_id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; }; - int64 id = 1; - int64 account_id = 2; + uint64 id = 1; + uint64 account_id = 2; string payment_category = 3; optional string bankname = 4; optional string IBAN = 5; diff --git a/bff/proto/person.proto b/bff/proto/person.proto index 49921e1..abe8acd 100644 --- a/bff/proto/person.proto +++ b/bff/proto/person.proto @@ -14,8 +14,8 @@ message Person { }; example: "{\"id\": \"1\",\"email\": \"john.doe@example.com\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"phone\": \"\", \"street\": \"Death Star 2\", \"zip\": \"0815\", \"city\": \"New York\", \"country\": \"USA\", \"birthday\": \"1990-10-05T00:00:00Z\", \"privacy_accepted\": false, \"privacy_accepted_date\": \"0001-01-01T00:00:00Z\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; }; - int64 id = 1; - int64 account_id = 2; + uint64 id = 1; + uint64 account_id = 2; string firstname = 3; string lastname = 4; string street = 5; diff --git a/bff/proto/rpc_create_payment.proto b/bff/proto/rpc_create_payment.proto index d8149d9..08bc07e 100644 --- a/bff/proto/rpc_create_payment.proto +++ b/bff/proto/rpc_create_payment.proto @@ -16,13 +16,12 @@ message CreatePaymentRequest { required: [ "account_id", "payment_category", - "payment_system", "type" ]; }; example: "{\"account_id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\"}"; }; - int64 account_id = 1; + uint64 account_id = 1; string payment_category = 2; optional string bankname = 3; optional string IBAN = 4; diff --git a/bff/proto/rpc_create_person.proto b/bff/proto/rpc_create_person.proto index 01c3bd1..a45e0ae 100644 --- a/bff/proto/rpc_create_person.proto +++ b/bff/proto/rpc_create_person.proto @@ -15,6 +15,7 @@ message CreatePersonRequest { title: "Create Person"; description: "Create an Person"; required: [ + "account_id", "firstname", "lastname", "street", @@ -26,7 +27,7 @@ message CreatePersonRequest { }; example: "{ \"account_id\": \"1\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"street\": \"Main Street 1\", \"zip\": \"0815\", \"city\": \"New York\", \"country\": \"USA\", \"birthday\": \"1990-10-05T00:00:00Z\"}"; }; - int64 account_id = 1; + uint64 account_id = 1; string firstname = 2; string lastname = 3; string street = 4; diff --git a/bff/proto/rpc_delete_payment.proto b/bff/proto/rpc_delete_payment.proto index f22fe79..7e01512 100644 --- a/bff/proto/rpc_delete_payment.proto +++ b/bff/proto/rpc_delete_payment.proto @@ -17,7 +17,7 @@ message DeletePaymentRequest { }; example: "{\"id\": \"1\"}" }; - int64 id = 1; + uint64 id = 1; } message DeletePaymentResponse { diff --git a/bff/proto/rpc_delete_person.proto b/bff/proto/rpc_delete_person.proto index 91082b1..5f7345f 100644 --- a/bff/proto/rpc_delete_person.proto +++ b/bff/proto/rpc_delete_person.proto @@ -17,7 +17,7 @@ message DeletePersonRequest { }; example: "{\"id\": \"1\"}" }; - int64 id = 1; + uint64 id = 1; } message DeletePersonResponse { diff --git a/bff/proto/rpc_get_account.proto b/bff/proto/rpc_get_account.proto index 0575226..48344f1 100644 --- a/bff/proto/rpc_get_account.proto +++ b/bff/proto/rpc_get_account.proto @@ -19,7 +19,7 @@ message GetAccountRequest { }; example: "{\"id\": \"1\" }"; }; - int64 id = 1; + uint64 id = 1; } message GetAccountResponse { diff --git a/bff/proto/rpc_get_payment.proto b/bff/proto/rpc_get_payment.proto index 576a2f3..fa47beb 100644 --- a/bff/proto/rpc_get_payment.proto +++ b/bff/proto/rpc_get_payment.proto @@ -19,7 +19,7 @@ message GetPaymentRequest { }; example: "{\"id\": \"1\" }"; }; - int64 id = 1; + uint64 id = 1; } message GetPaymentResponse { diff --git a/bff/proto/rpc_get_person.proto b/bff/proto/rpc_get_person.proto index 9fe31e4..927d203 100644 --- a/bff/proto/rpc_get_person.proto +++ b/bff/proto/rpc_get_person.proto @@ -19,7 +19,7 @@ message GetPersonRequest { }; example: "{\"id\": \"1\" }"; }; - int64 id = 1; + uint64 id = 1; } message GetPersonResponse { diff --git a/bff/proto/rpc_list_accounts.proto b/bff/proto/rpc_list_accounts.proto index f972bfa..6426b3e 100644 --- a/bff/proto/rpc_list_accounts.proto +++ b/bff/proto/rpc_list_accounts.proto @@ -14,13 +14,14 @@ message ListAccountsRequest { title: "ListAccounts"; description: "Returns a List of Accounts"; required: [ - "id" + "page_id", + "page_size" ]; }; example: "{\"page_id\": 1, \"page_size\": 10 }"; }; - int32 page_id = 1; - int32 page_size = 2; + uint32 page_id = 1; + uint32 page_size = 2; } message ListAccountsResponse { diff --git a/bff/proto/rpc_list_payments.proto b/bff/proto/rpc_list_payments.proto index fa7ffb3..d004626 100644 --- a/bff/proto/rpc_list_payments.proto +++ b/bff/proto/rpc_list_payments.proto @@ -19,7 +19,7 @@ message ListPaymentsRequest { }; example: "{\"account_id\": 1 }"; }; - int64 account_id = 1; + uint64 account_id = 1; } message ListPaymentsResponse { diff --git a/bff/proto/rpc_list_persons.proto b/bff/proto/rpc_list_persons.proto index 848af46..605c6be 100644 --- a/bff/proto/rpc_list_persons.proto +++ b/bff/proto/rpc_list_persons.proto @@ -19,7 +19,7 @@ message ListPersonsRequest { }; example: "{\"account_id\": 1 }"; }; - int64 account_id = 1; + uint64 account_id = 1; } message ListPersonsResponse { diff --git a/bff/proto/rpc_list_sessions.proto b/bff/proto/rpc_list_sessions.proto index e0a4cdd..5bc3d73 100644 --- a/bff/proto/rpc_list_sessions.proto +++ b/bff/proto/rpc_list_sessions.proto @@ -19,7 +19,7 @@ message ListSessionsRequest { }; example: "{\"account_id\": \"1\" }"; }; - int64 account_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + uint64 account_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "1", format: "int64" }]; diff --git a/bff/proto/rpc_update_account.proto b/bff/proto/rpc_update_account.proto index 689c4d7..9f6e92e 100644 --- a/bff/proto/rpc_update_account.proto +++ b/bff/proto/rpc_update_account.proto @@ -20,7 +20,7 @@ message UpdateAccountRequest { }; example: "{\"id\": \"1\", \"street\": \"Death Star 2\"}"; }; - int64 id = 1; + uint64 id = 1; optional string email = 2; optional string password = 3; optional string firstname = 4; diff --git a/bff/proto/rpc_update_account_privacy.proto b/bff/proto/rpc_update_account_privacy.proto index dbba084..01f67f8 100644 --- a/bff/proto/rpc_update_account_privacy.proto +++ b/bff/proto/rpc_update_account_privacy.proto @@ -20,7 +20,7 @@ message UpdateAccountPrivacyRequest { }; example: "{\"id\": \"1\", \"privacy_accepted\": true }" }; - int64 id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + uint64 id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "1", format: "int64" }]; diff --git a/bff/proto/rpc_update_payment.proto b/bff/proto/rpc_update_payment.proto index 59b911d..2207dc6 100644 --- a/bff/proto/rpc_update_payment.proto +++ b/bff/proto/rpc_update_payment.proto @@ -19,7 +19,7 @@ message UpdatePaymentRequest { }; example: "{\"id\": \"1\", \"payment_category\": \"TBD: paypal\", \"paypal_account\": \"john.doe@example.com\", \"paypal_id\": \"this-is-a-paypal-id\", \"payment_system\": \"TBD: paypal system\", \"type\": \"TBD: some type\"}"; }; - int64 id = 1; + uint64 id = 1; optional string payment_category = 2; optional string bankname = 3; optional string IBAN = 4; diff --git a/bff/sqlc.yaml b/bff/sqlc.yaml index 93d369b..92a4550 100644 --- a/bff/sqlc.yaml +++ b/bff/sqlc.yaml @@ -13,6 +13,11 @@ sql: emit_empty_slices: true emit_exact_table_names: false overrides: + - db_type: "bigserial" + go_type: "uint64" + - db_type: "bigint" + null: false + go_type: "uint64" - db_type: "timestamptz" go_type: "time.Time" - db_type: "uuid" diff --git a/bff/util/random.go b/bff/util/random.go index 105e238..4d737b2 100644 --- a/bff/util/random.go +++ b/bff/util/random.go @@ -9,8 +9,8 @@ const alphabet = "abcdefghijklmnopqrstuvwxyz" const numbers = "0123456789" // RandomInt generates a random number between min and max -func RandomInt(min, max int64) int64 { - return min + rand.Int63n(max-min+1) +func RandomInt(min, max int64) uint64 { + return uint64(min + rand.Int63n(max-min+1)) } // RandomString generates a random string of length n From f25bbb347c2d4962e49f21008fbff7c03c301e57 Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 10 Oct 2023 00:17:52 +0200 Subject: [PATCH 06/15] rf/improves *_id uint64 handling --- bff/db/mock/store.go | 6 +- bff/db/query/document.sql | 11 +-- bff/db/query/payment.sql | 5 +- bff/db/query/person.sql | 1 - bff/db/query/return.sql | 2 - bff/db/query/returnsLog.sql | 2 - bff/db/sqlc/document.sql.go | 33 +++++---- bff/db/sqlc/models.go | 12 ++-- bff/db/sqlc/payment.sql.go | 35 +++++---- bff/db/sqlc/payment_test.go | 112 ++++++++++++++--------------- bff/db/sqlc/person.sql.go | 23 +++--- bff/db/sqlc/person_test.go | 2 +- bff/db/sqlc/querier.go | 6 +- bff/db/sqlc/return.sql.go | 26 +++---- bff/db/sqlc/return_test.go | 4 +- bff/db/sqlc/returnsLog.sql.go | 26 +++---- bff/db/sqlc/returnsLog_test.go | 4 +- bff/db/sqlc/tx_create_person.go | 4 +- bff/doc/swagger/df.swagger.json | 4 +- bff/gapi/rpc_create_payment.go | 3 +- bff/gapi/rpc_create_person.go | 3 +- bff/gapi/rpc_delete_payment.go | 7 +- bff/gapi/rpc_delete_person.go | 7 +- bff/gapi/rpc_get_payment.go | 4 +- bff/gapi/rpc_get_person.go | 4 +- bff/gapi/rpc_list_payments.go | 4 +- bff/gapi/rpc_list_persons.go | 4 +- bff/gapi/rpc_update_payment.go | 6 +- bff/pb/rpc_delete_payment.pb.go | 8 +-- bff/pb/rpc_delete_person.pb.go | 8 +-- bff/proto/rpc_delete_payment.proto | 2 +- bff/proto/rpc_delete_person.proto | 2 +- bff/sqlc.yaml | 15 +++- 33 files changed, 181 insertions(+), 214 deletions(-) diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index 7bd70f9..e102dcc 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -510,7 +510,7 @@ func (mr *MockStoreMockRecorder) GetReturn(arg0, arg1 any) *gomock.Call { } // GetReturns mocks base method. -func (m *MockStore) GetReturns(arg0 context.Context, arg1 int64) ([]db.Return, error) { +func (m *MockStore) GetReturns(arg0 context.Context, arg1 uint64) ([]db.Return, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetReturns", arg0, arg1) ret0, _ := ret[0].([]db.Return) @@ -615,7 +615,7 @@ func (mr *MockStoreMockRecorder) ListMails(arg0, arg1 any) *gomock.Call { } // ListPayments mocks base method. -func (m *MockStore) ListPayments(arg0 context.Context, arg1 int64) ([]db.Payment, error) { +func (m *MockStore) ListPayments(arg0 context.Context, arg1 uint64) ([]db.Payment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListPayments", arg0, arg1) ret0, _ := ret[0].([]db.Payment) @@ -630,7 +630,7 @@ func (mr *MockStoreMockRecorder) ListPayments(arg0, arg1 any) *gomock.Call { } // ListPersons mocks base method. -func (m *MockStore) ListPersons(arg0 context.Context, arg1 int64) ([]db.Person, error) { +func (m *MockStore) ListPersons(arg0 context.Context, arg1 uint64) ([]db.Person, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListPersons", arg0, arg1) ret0, _ := ret[0].([]db.Person) diff --git a/bff/db/query/document.sql b/bff/db/query/document.sql index ff2afa3..eadc243 100644 --- a/bff/db/query/document.sql +++ b/bff/db/query/document.sql @@ -10,9 +10,10 @@ INSERT INTO documents ( "path", "url", "creator", - "changer" + "changer", + "mail_id" ) VALUES ( - $1, $2, $3, $4, $5, $6, $7 + $1, $2, $3, $4, $5, $6, $7, NULL ) RETURNING *; -- name: CreateDocumentMail :one @@ -23,9 +24,10 @@ INSERT INTO documents ( "path", "url", "creator", - "changer" + "changer", + "person_id" ) VALUES ( - $1, $2, $3, $4, $5, $6, $7 + $1, $2, $3, $4, $5, $6, $7, NULL ) RETURNING *; -- name: ListDocuments :many @@ -37,7 +39,6 @@ OFFSET $2; -- name: UpdateDocument :one UPDATE documents SET - "person_id" = COALESCE(sqlc.narg(person_id), "person_id"), "name" = COALESCE(sqlc.narg(name), "name"), "type" = COALESCE(sqlc.narg(type), "type"), "path" = COALESCE(sqlc.narg(path), "path"), diff --git a/bff/db/query/payment.sql b/bff/db/query/payment.sql index a3f726c..1fbe330 100644 --- a/bff/db/query/payment.sql +++ b/bff/db/query/payment.sql @@ -27,7 +27,6 @@ ORDER BY "payment_category"; -- name: UpdatePayment :one UPDATE payments SET - "account_id" = COALESCE(sqlc.narg(account_id), "account_id"), "payment_category" = COALESCE(sqlc.narg(payment_category), "payment_category"), "bankname" = COALESCE(sqlc.narg(bankname), "bankname"), "IBAN" = COALESCE(sqlc.narg(IBAN), "IBAN"), @@ -36,9 +35,9 @@ SET "paypal_id" = COALESCE(sqlc.narg(paypal_id), "paypal_id"), "payment_system" = COALESCE(sqlc.narg(payment_system), "payment_system"), "type" = COALESCE(sqlc.narg(type), "type"), - "changer" = $2, + "changer" = sqlc.arg(changer), "changed" = now() -WHERE "id" = $1 +WHERE "id" = sqlc.arg(id) RETURNING *; -- name: DeletePayment :exec diff --git a/bff/db/query/person.sql b/bff/db/query/person.sql index 4c1fe63..d64a659 100644 --- a/bff/db/query/person.sql +++ b/bff/db/query/person.sql @@ -26,7 +26,6 @@ ORDER BY "lastname", "firstname"; -- name: UpdatePerson :one UPDATE persons SET - "account_id" = COALESCE(sqlc.narg(account_id), "account_id"), "firstname" = COALESCE(sqlc.narg(firstname), "firstname"), "lastname" = COALESCE(sqlc.narg(lastname), "lastname"), "birthday" = COALESCE(sqlc.narg(birthday), "birthday"), diff --git a/bff/db/query/return.sql b/bff/db/query/return.sql index 9abcc77..eb551cb 100644 --- a/bff/db/query/return.sql +++ b/bff/db/query/return.sql @@ -34,8 +34,6 @@ OFFSET $2; -- name: UpdateReturn :one UPDATE returns SET - "person_id" = COALESCE(sqlc.narg(person_id), "person_id"), - "provider_id" = COALESCE(sqlc.narg(provider_id), "provider_id"), "name" = COALESCE(sqlc.narg(name), "name"), "description" = COALESCE(sqlc.narg(description), "description"), "category" = COALESCE(sqlc.narg(category), "category"), diff --git a/bff/db/query/returnsLog.sql b/bff/db/query/returnsLog.sql index 3b33e2a..f6bcbe4 100644 --- a/bff/db/query/returnsLog.sql +++ b/bff/db/query/returnsLog.sql @@ -26,8 +26,6 @@ OFFSET $2; -- name: UpdateReturnsLog :one UPDATE "returnsLog" SET - "return_id" = COALESCE(sqlc.narg(return_id), "return_id"), - "mail_id" = COALESCE(sqlc.narg(mail_id), "mail_id"), "status" = COALESCE(sqlc.narg(status), "status"), "changer" = $1, "changed" = now() diff --git a/bff/db/sqlc/document.sql.go b/bff/db/sqlc/document.sql.go index e6b2825..7fbccaa 100644 --- a/bff/db/sqlc/document.sql.go +++ b/bff/db/sqlc/document.sql.go @@ -18,9 +18,10 @@ INSERT INTO documents ( "path", "url", "creator", - "changer" + "changer", + "person_id" ) VALUES ( - $1, $2, $3, $4, $5, $6, $7 + $1, $2, $3, $4, $5, $6, $7, NULL ) RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` @@ -72,9 +73,10 @@ INSERT INTO documents ( "path", "url", "creator", - "changer" + "changer", + "mail_id" ) VALUES ( - $1, $2, $3, $4, $5, $6, $7 + $1, $2, $3, $4, $5, $6, $7, NULL ) RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` @@ -247,11 +249,10 @@ func (q *Queries) ListDocuments(ctx context.Context, arg ListDocumentsParams) ([ const updateDocument = `-- name: UpdateDocument :one UPDATE documents SET - "person_id" = COALESCE($3, "person_id"), - "name" = COALESCE($4, "name"), - "type" = COALESCE($5, "type"), - "path" = COALESCE($6, "path"), - "url" = COALESCE($7, "url"), + "name" = COALESCE($3, "name"), + "type" = COALESCE($4, "type"), + "path" = COALESCE($5, "path"), + "url" = COALESCE($6, "url"), changer = $2, changed = now() WHERE "id" = $1 @@ -259,20 +260,18 @@ RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, ` type UpdateDocumentParams struct { - ID uint64 `json:"id"` - Changer string `json:"changer"` - PersonID sql.NullInt64 `json:"person_id"` - Name sql.NullString `json:"name"` - Type sql.NullString `json:"type"` - Path sql.NullString `json:"path"` - Url sql.NullString `json:"url"` + ID uint64 `json:"id"` + Changer string `json:"changer"` + Name sql.NullString `json:"name"` + Type sql.NullString `json:"type"` + Path sql.NullString `json:"path"` + Url sql.NullString `json:"url"` } func (q *Queries) UpdateDocument(ctx context.Context, arg UpdateDocumentParams) (Document, error) { row := q.db.QueryRowContext(ctx, updateDocument, arg.ID, arg.Changer, - arg.PersonID, arg.Name, arg.Type, arg.Path, diff --git a/bff/db/sqlc/models.go b/bff/db/sqlc/models.go index b27c817..57f9915 100644 --- a/bff/db/sqlc/models.go +++ b/bff/db/sqlc/models.go @@ -65,7 +65,7 @@ type Mail struct { type Payment struct { ID uint64 `json:"id"` - AccountID int64 `json:"account_id"` + AccountID uint64 `json:"account_id"` PaymentCategory string `json:"payment_category"` Bankname sql.NullString `json:"bankname"` IBAN sql.NullString `json:"IBAN"` @@ -82,7 +82,7 @@ type Payment struct { type Person struct { ID uint64 `json:"id"` - AccountID int64 `json:"account_id"` + AccountID uint64 `json:"account_id"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` Birthday time.Time `json:"birthday"` @@ -110,8 +110,8 @@ type Provider struct { type Return struct { ID uint64 `json:"id"` - PersonID int64 `json:"person_id"` - ProviderID int64 `json:"provider_id"` + PersonID uint64 `json:"person_id"` + ProviderID uint64 `json:"provider_id"` Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` @@ -125,8 +125,8 @@ type Return struct { type ReturnsLog struct { ID uint64 `json:"id"` - ReturnID int64 `json:"return_id"` - MailID int64 `json:"mail_id"` + ReturnID uint64 `json:"return_id"` + MailID uint64 `json:"mail_id"` Status sql.NullString `json:"status"` Creator string `json:"creator"` Created time.Time `json:"created"` diff --git a/bff/db/sqlc/payment.sql.go b/bff/db/sqlc/payment.sql.go index c1eb584..4b1ee17 100644 --- a/bff/db/sqlc/payment.sql.go +++ b/bff/db/sqlc/payment.sql.go @@ -29,7 +29,7 @@ INSERT INTO payments ( ` type CreatePaymentParams struct { - AccountID int64 `json:"account_id"` + AccountID uint64 `json:"account_id"` PaymentCategory string `json:"payment_category"` Bankname sql.NullString `json:"bankname"` IBAN sql.NullString `json:"IBAN"` @@ -119,7 +119,7 @@ WHERE "account_id" = $1 ORDER BY "payment_category" ` -func (q *Queries) ListPayments(ctx context.Context, accountID int64) ([]Payment, error) { +func (q *Queries) ListPayments(ctx context.Context, accountID uint64) ([]Payment, error) { rows, err := q.db.QueryContext(ctx, listPayments, accountID) if err != nil { return nil, err @@ -160,25 +160,21 @@ func (q *Queries) ListPayments(ctx context.Context, accountID int64) ([]Payment, const updatePayment = `-- name: UpdatePayment :one UPDATE payments SET - "account_id" = COALESCE($3, "account_id"), - "payment_category" = COALESCE($4, "payment_category"), - "bankname" = COALESCE($5, "bankname"), - "IBAN" = COALESCE($6, "IBAN"), - "BIC" = COALESCE($7, "BIC"), - "paypal_account" = COALESCE($8, "paypal_account"), - "paypal_id" = COALESCE($9, "paypal_id"), - "payment_system" = COALESCE($10, "payment_system"), - "type" = COALESCE($11, "type"), - "changer" = $2, + "payment_category" = COALESCE($1, "payment_category"), + "bankname" = COALESCE($2, "bankname"), + "IBAN" = COALESCE($3, "IBAN"), + "BIC" = COALESCE($4, "BIC"), + "paypal_account" = COALESCE($5, "paypal_account"), + "paypal_id" = COALESCE($6, "paypal_id"), + "payment_system" = COALESCE($7, "payment_system"), + "type" = COALESCE($8, "type"), + "changer" = $9, "changed" = now() -WHERE "id" = $1 +WHERE "id" = $10 RETURNING id, account_id, payment_category, bankname, "IBAN", "BIC", paypal_account, paypal_id, payment_system, type, creator, created, changer, changed ` type UpdatePaymentParams struct { - ID uint64 `json:"id"` - Changer string `json:"changer"` - AccountID sql.NullInt64 `json:"account_id"` PaymentCategory sql.NullString `json:"payment_category"` Bankname sql.NullString `json:"bankname"` Iban sql.NullString `json:"iban"` @@ -187,13 +183,12 @@ type UpdatePaymentParams struct { PaypalID sql.NullString `json:"paypal_id"` PaymentSystem sql.NullString `json:"payment_system"` Type sql.NullString `json:"type"` + Changer string `json:"changer"` + ID uint64 `json:"id"` } func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (Payment, error) { row := q.db.QueryRowContext(ctx, updatePayment, - arg.ID, - arg.Changer, - arg.AccountID, arg.PaymentCategory, arg.Bankname, arg.Iban, @@ -202,6 +197,8 @@ func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (P arg.PaypalID, arg.PaymentSystem, arg.Type, + arg.Changer, + arg.ID, ) var i Payment err := row.Scan( diff --git a/bff/db/sqlc/payment_test.go b/bff/db/sqlc/payment_test.go index 48db528..844f77a 100644 --- a/bff/db/sqlc/payment_test.go +++ b/bff/db/sqlc/payment_test.go @@ -10,6 +10,27 @@ import ( "github.com/stretchr/testify/require" ) +func TestUpdatePayment(t *testing.T) { + payment1 := createRandomPayment(t) + require.NotEmpty(t, payment1) + + arg := UpdatePaymentParams{ + ID: payment1.ID, + Bankname: sql.NullString{ + String: util.RandomName(), + Valid: true, + }, + } + + payment2, err := testQueries.UpdatePayment(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, payment2) + + require.Equal(t, payment1.ID, payment2.ID) + require.Equal(t, payment1.PaymentCategory, payment2.PaymentCategory) + require.NotEqual(t, payment1.Bankname, payment2.Bankname) +} + func createRandomPayment(t *testing.T) Payment { account := createRandomAccount(t) require.NotEmpty(t, account) @@ -17,7 +38,7 @@ func createRandomPayment(t *testing.T) Payment { creator := util.RandomName() arg := CreatePaymentParams{ - AccountID: int64(account.ID), + AccountID: account.ID, PaymentCategory: util.RandomName(), Bankname: sql.NullString{ Valid: true, @@ -48,25 +69,25 @@ func createRandomPayment(t *testing.T) Payment { Changer: creator, } - person, err := testQueries.CreatePayment(context.Background(), arg) + payment, err := testQueries.CreatePayment(context.Background(), arg) require.NoError(t, err) - require.NotEmpty(t, person) + require.NotEmpty(t, payment) - require.Equal(t, arg.PaymentCategory, person.PaymentCategory) - require.Equal(t, arg.Bankname, person.Bankname) - require.Equal(t, arg.AccountID, person.AccountID) - require.Equal(t, arg.IBAN, person.IBAN) - require.Equal(t, arg.BIC, person.BIC) - require.Equal(t, arg.PaypalAccount, person.PaypalAccount) - require.Equal(t, arg.PaymentSystem, person.PaymentSystem) - require.Equal(t, arg.PaypalID, person.PaypalID) - require.Equal(t, arg.Creator, person.Creator) - require.Equal(t, arg.Type, person.Type) + require.Equal(t, arg.PaymentCategory, payment.PaymentCategory) + require.Equal(t, arg.Bankname, payment.Bankname) + require.Equal(t, arg.AccountID, payment.AccountID) + require.Equal(t, arg.IBAN, payment.IBAN) + require.Equal(t, arg.BIC, payment.BIC) + require.Equal(t, arg.PaypalAccount, payment.PaypalAccount) + require.Equal(t, arg.PaymentSystem, payment.PaymentSystem) + require.Equal(t, arg.PaypalID, payment.PaypalID) + require.Equal(t, arg.Creator, payment.Creator) + require.Equal(t, arg.Type, payment.Type) - require.NotZero(t, person.ID) - require.NotZero(t, person.Created) + require.NotZero(t, payment.ID) + require.NotZero(t, payment.Created) - return person + return payment } func TestCreatePayment(t *testing.T) { @@ -74,55 +95,34 @@ func TestCreatePayment(t *testing.T) { } func TestGetPayment(t *testing.T) { - newperson := createRandomPayment(t) - require.NotEmpty(t, newperson) + newpayment := createRandomPayment(t) + require.NotEmpty(t, newpayment) - person, err := testQueries.GetPayment(context.Background(), newperson.ID) + payment, err := testQueries.GetPayment(context.Background(), newpayment.ID) require.NoError(t, err) - require.NotEmpty(t, person) + require.NotEmpty(t, payment) - require.Equal(t, newperson.PaymentCategory, person.PaymentCategory) - require.Equal(t, newperson.Bankname, person.Bankname) - require.Equal(t, newperson.AccountID, person.AccountID) - require.Equal(t, newperson.IBAN, person.IBAN) - require.Equal(t, newperson.BIC, person.BIC) - require.Equal(t, newperson.PaypalAccount, person.PaypalAccount) - require.Equal(t, newperson.PaymentSystem, person.PaymentSystem) - require.Equal(t, newperson.PaypalID, person.PaypalID) - require.Equal(t, newperson.Creator, person.Creator) - require.Equal(t, newperson.Type, person.Type) + require.Equal(t, newpayment.PaymentCategory, payment.PaymentCategory) + require.Equal(t, newpayment.Bankname, payment.Bankname) + require.Equal(t, newpayment.AccountID, payment.AccountID) + require.Equal(t, newpayment.IBAN, payment.IBAN) + require.Equal(t, newpayment.BIC, payment.BIC) + require.Equal(t, newpayment.PaypalAccount, payment.PaypalAccount) + require.Equal(t, newpayment.PaymentSystem, payment.PaymentSystem) + require.Equal(t, newpayment.PaypalID, payment.PaypalID) + require.Equal(t, newpayment.Creator, payment.Creator) + require.Equal(t, newpayment.Type, payment.Type) - require.WithinDuration(t, newperson.Created, person.Created, time.Second) + require.WithinDuration(t, newpayment.Created, payment.Created, time.Second) } func TestDeletePayment(t *testing.T) { - person1 := createRandomPayment(t) - err := testQueries.DeletePayment(context.Background(), person1.ID) + payment1 := createRandomPayment(t) + err := testQueries.DeletePayment(context.Background(), payment1.ID) require.NoError(t, err) - person2, err := testQueries.GetPayment(context.Background(), person1.ID) + payment2, err := testQueries.GetPayment(context.Background(), payment1.ID) require.Error(t, err) require.EqualError(t, err, sql.ErrNoRows.Error()) - require.Empty(t, person2) -} - -func TestUpdatePayment(t *testing.T) { - person1 := createRandomPayment(t) - require.NotEmpty(t, person1) - - arg := UpdatePaymentParams{ - ID: person1.ID, - Bankname: sql.NullString{ - String: util.RandomName(), - Valid: true, - }, - } - - person2, err := testQueries.UpdatePayment(context.Background(), arg) - require.NoError(t, err) - require.NotEmpty(t, person2) - - require.Equal(t, person1.ID, person2.ID) - require.Equal(t, person1.PaymentCategory, person2.PaymentCategory) - require.NotEqual(t, person1.Bankname, person2.Bankname) + require.Empty(t, payment2) } diff --git a/bff/db/sqlc/person.sql.go b/bff/db/sqlc/person.sql.go index ddfd32e..8eb9693 100644 --- a/bff/db/sqlc/person.sql.go +++ b/bff/db/sqlc/person.sql.go @@ -29,7 +29,7 @@ INSERT INTO persons ( ` type CreatePersonParams struct { - AccountID int64 `json:"account_id"` + AccountID uint64 `json:"account_id"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` Birthday time.Time `json:"birthday"` @@ -114,7 +114,7 @@ SELECT id, person_id, provider_id, name, description, category, email, status, c WHERE "person_id" = $1 ` -func (q *Queries) GetReturns(ctx context.Context, id int64) ([]Return, error) { +func (q *Queries) GetReturns(ctx context.Context, id uint64) ([]Return, error) { rows, err := q.db.QueryContext(ctx, getReturns, id) if err != nil { return nil, err @@ -156,7 +156,7 @@ WHERE "account_id" = $1 ORDER BY "lastname", "firstname" ` -func (q *Queries) ListPersons(ctx context.Context, accountID int64) ([]Person, error) { +func (q *Queries) ListPersons(ctx context.Context, accountID uint64) ([]Person, error) { rows, err := q.db.QueryContext(ctx, listPersons, accountID) if err != nil { return nil, err @@ -196,14 +196,13 @@ func (q *Queries) ListPersons(ctx context.Context, accountID int64) ([]Person, e const updatePerson = `-- name: UpdatePerson :one UPDATE persons SET - "account_id" = COALESCE($3, "account_id"), - "firstname" = COALESCE($4, "firstname"), - "lastname" = COALESCE($5, "lastname"), - "birthday" = COALESCE($6, "birthday"), - "city" = COALESCE($7, "city"), - "zip" = COALESCE($8, "zip"), - "street" = COALESCE($9, "street"), - "country" = COALESCE($10, "country"), + "firstname" = COALESCE($3, "firstname"), + "lastname" = COALESCE($4, "lastname"), + "birthday" = COALESCE($5, "birthday"), + "city" = COALESCE($6, "city"), + "zip" = COALESCE($7, "zip"), + "street" = COALESCE($8, "street"), + "country" = COALESCE($9, "country"), "changer" = $2, "changed" = now() WHERE "id" = $1 @@ -213,7 +212,6 @@ RETURNING id, account_id, firstname, lastname, birthday, city, zip, street, coun type UpdatePersonParams struct { ID uint64 `json:"id"` Changer string `json:"changer"` - AccountID sql.NullInt64 `json:"account_id"` Firstname sql.NullString `json:"firstname"` Lastname sql.NullString `json:"lastname"` Birthday sql.NullTime `json:"birthday"` @@ -227,7 +225,6 @@ func (q *Queries) UpdatePerson(ctx context.Context, arg UpdatePersonParams) (Per row := q.db.QueryRowContext(ctx, updatePerson, arg.ID, arg.Changer, - arg.AccountID, arg.Firstname, arg.Lastname, arg.Birthday, diff --git a/bff/db/sqlc/person_test.go b/bff/db/sqlc/person_test.go index 85780e6..8a1256c 100644 --- a/bff/db/sqlc/person_test.go +++ b/bff/db/sqlc/person_test.go @@ -17,7 +17,7 @@ func createRandomPerson(t *testing.T) Person { creator := util.RandomName() arg := CreatePersonParams{ - AccountID: int64(account.ID), + AccountID: account.ID, Firstname: util.RandomName(), Lastname: util.RandomName(), Birthday: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC), diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index 9f3282d..91dddfc 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -53,15 +53,15 @@ type Querier interface { GetPerson(ctx context.Context, id uint64) (Person, error) GetProvider(ctx context.Context, id uint64) (Provider, error) GetReturn(ctx context.Context, id uint64) (Return, error) - GetReturns(ctx context.Context, id int64) ([]Return, error) + GetReturns(ctx context.Context, id uint64) ([]Return, error) GetReturnsLog(ctx context.Context, id uint64) (ReturnsLog, error) GetSession(ctx context.Context, id uuid.UUID) (Session, error) InvalidateDocument(ctx context.Context, arg InvalidateDocumentParams) (Document, error) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error) ListDocuments(ctx context.Context, arg ListDocumentsParams) ([]Document, error) ListMails(ctx context.Context, arg ListMailsParams) ([]Mail, error) - ListPayments(ctx context.Context, accountID int64) ([]Payment, error) - ListPersons(ctx context.Context, accountID int64) ([]Person, error) + ListPayments(ctx context.Context, accountID uint64) ([]Payment, error) + ListPersons(ctx context.Context, accountID uint64) ([]Person, error) ListProviders(ctx context.Context, arg ListProvidersParams) ([]Provider, error) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams) ([]ReturnsLog, error) diff --git a/bff/db/sqlc/return.sql.go b/bff/db/sqlc/return.sql.go index 915158d..4618e2e 100644 --- a/bff/db/sqlc/return.sql.go +++ b/bff/db/sqlc/return.sql.go @@ -37,7 +37,7 @@ FROM providers type CloneProvidersParams struct { Creator string `json:"creator"` - PersonID int64 `json:"person_id"` + PersonID uint64 `json:"person_id"` } func (q *Queries) CloneProviders(ctx context.Context, arg CloneProvidersParams) error { @@ -70,8 +70,8 @@ INSERT INTO returns ( ` type CreateReturnParams struct { - PersonID int64 `json:"person_id"` - ProviderID int64 `json:"provider_id"` + PersonID uint64 `json:"person_id"` + ProviderID uint64 `json:"provider_id"` Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` @@ -197,22 +197,18 @@ func (q *Queries) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Ret const updateReturn = `-- name: UpdateReturn :one UPDATE returns SET - "person_id" = COALESCE($1, "person_id"), - "provider_id" = COALESCE($2, "provider_id"), - "name" = COALESCE($3, "name"), - "description" = COALESCE($4, "description"), - "category" = COALESCE($5, "category"), - "email" = COALESCE($6, "email"), - "status" = COALESCE($7, "status"), - "changer" = $8, + "name" = COALESCE($1, "name"), + "description" = COALESCE($2, "description"), + "category" = COALESCE($3, "category"), + "email" = COALESCE($4, "email"), + "status" = COALESCE($5, "status"), + "changer" = $6, "changed" = now() -WHERE "id" = $9 +WHERE "id" = $7 RETURNING id, person_id, provider_id, name, description, category, email, status, creator, created, changer, changed ` type UpdateReturnParams struct { - PersonID sql.NullInt64 `json:"person_id"` - ProviderID sql.NullInt64 `json:"provider_id"` Name sql.NullString `json:"name"` Description sql.NullString `json:"description"` Category sql.NullString `json:"category"` @@ -224,8 +220,6 @@ type UpdateReturnParams struct { func (q *Queries) UpdateReturn(ctx context.Context, arg UpdateReturnParams) (Return, error) { row := q.db.QueryRowContext(ctx, updateReturn, - arg.PersonID, - arg.ProviderID, arg.Name, arg.Description, arg.Category, diff --git a/bff/db/sqlc/return_test.go b/bff/db/sqlc/return_test.go index a57bbee..019caf1 100644 --- a/bff/db/sqlc/return_test.go +++ b/bff/db/sqlc/return_test.go @@ -18,8 +18,8 @@ func createRandomReturn(t *testing.T) Return { creator := util.RandomName() arg := CreateReturnParams{ - PersonID: int64(person.ID), - ProviderID: int64(provider.ID), + PersonID: person.ID, + ProviderID: provider.ID, Status: util.RandomString(7), Name: util.RandomName(), Description: util.RandomString(30), diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index 1fac37e..380feee 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -27,8 +27,8 @@ INSERT INTO "returnsLog" ( ` type CreateReturnsLogParams struct { - ReturnID int64 `json:"return_id"` - MailID int64 `json:"mail_id"` + ReturnID uint64 `json:"return_id"` + MailID uint64 `json:"mail_id"` Status sql.NullString `json:"status"` Creator string `json:"creator"` } @@ -132,31 +132,21 @@ func (q *Queries) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams const updateReturnsLog = `-- name: UpdateReturnsLog :one UPDATE "returnsLog" SET - "return_id" = COALESCE($2, "return_id"), - "mail_id" = COALESCE($3, "mail_id"), - "status" = COALESCE($4, "status"), + "status" = COALESCE($2, "status"), "changer" = $1, "changed" = now() -WHERE "id" = $5 +WHERE "id" = $3 RETURNING id, return_id, mail_id, status, creator, created, changer, changed ` type UpdateReturnsLogParams struct { - Changer string `json:"changer"` - ReturnID sql.NullInt64 `json:"return_id"` - MailID sql.NullInt64 `json:"mail_id"` - Status sql.NullString `json:"status"` - ID uint64 `json:"id"` + Changer string `json:"changer"` + Status sql.NullString `json:"status"` + ID uint64 `json:"id"` } func (q *Queries) UpdateReturnsLog(ctx context.Context, arg UpdateReturnsLogParams) (ReturnsLog, error) { - row := q.db.QueryRowContext(ctx, updateReturnsLog, - arg.Changer, - arg.ReturnID, - arg.MailID, - arg.Status, - arg.ID, - ) + row := q.db.QueryRowContext(ctx, updateReturnsLog, arg.Changer, arg.Status, arg.ID) var i ReturnsLog err := row.Scan( &i.ID, diff --git a/bff/db/sqlc/returnsLog_test.go b/bff/db/sqlc/returnsLog_test.go index 51bb91d..30beeee 100644 --- a/bff/db/sqlc/returnsLog_test.go +++ b/bff/db/sqlc/returnsLog_test.go @@ -18,8 +18,8 @@ func createRandomReturnsLog(t *testing.T) ReturnsLog { creator := util.RandomName() arg := CreateReturnsLogParams{ - ReturnID: int64(ret.ID), - MailID: int64(mail.ID), + ReturnID: ret.ID, + MailID: mail.ID, Status: sql.NullString{ Valid: true, String: util.RandomString(7), diff --git a/bff/db/sqlc/tx_create_person.go b/bff/db/sqlc/tx_create_person.go index 68ef658..953edcf 100644 --- a/bff/db/sqlc/tx_create_person.go +++ b/bff/db/sqlc/tx_create_person.go @@ -6,7 +6,7 @@ import ( ) type CreatePersonTxParams struct { - AccountID int64 `json:"account_id"` + AccountID uint64 `json:"account_id"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` Birthday time.Time `json:"birthday"` @@ -35,7 +35,7 @@ func (store *SQLStore) CreatePersonTx(ctx context.Context, arg CreatePersonTxPar err = q.CloneProviders(ctx, CloneProvidersParams{ Creator: arg.Creator, - PersonID: int64(result.Person.ID), + PersonID: result.Person.ID, }) return err }) diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index 2eac134..a4135a5 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -1015,7 +1015,7 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "deleted": { "type": "boolean" @@ -1032,7 +1032,7 @@ "properties": { "id": { "type": "string", - "format": "int64" + "format": "uint64" }, "deleted": { "type": "boolean" diff --git a/bff/gapi/rpc_create_payment.go b/bff/gapi/rpc_create_payment.go index f1278b0..ea36c1f 100644 --- a/bff/gapi/rpc_create_payment.go +++ b/bff/gapi/rpc_create_payment.go @@ -38,9 +38,8 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe } } - accountID := int64(req.GetAccountId()) arg := db.CreatePaymentParams{ - AccountID: accountID, + AccountID: req.GetAccountId(), PaymentCategory: req.GetPaymentCategory(), Bankname: sql.NullString{ Valid: req.GetBankname() != "", diff --git a/bff/gapi/rpc_create_person.go b/bff/gapi/rpc_create_person.go index 8985917..09c9d83 100644 --- a/bff/gapi/rpc_create_person.go +++ b/bff/gapi/rpc_create_person.go @@ -38,9 +38,8 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ } } - accountID := int64(req.GetAccountId()) arg := db.CreatePersonTxParams{ - AccountID: accountID, + AccountID: account.ID, Firstname: req.GetFirstname(), Lastname: req.GetLastname(), Birthday: req.GetBirthday().AsTime(), diff --git a/bff/gapi/rpc_delete_payment.go b/bff/gapi/rpc_delete_payment.go index f635ea8..15b5f43 100644 --- a/bff/gapi/rpc_delete_payment.go +++ b/bff/gapi/rpc_delete_payment.go @@ -44,10 +44,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe return nil, status.Errorf(codes.Internal, "failed to get payment") } - paymentID := int64(req.GetId()) - accountID := int64(account.ID) - - if payment.AccountID != accountID { + if payment.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "payment not found") } @@ -60,7 +57,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe } rsp := &pb.DeletePaymentResponse{ - Id: paymentID, + Id: payment.ID, Deleted: true, } return rsp, nil diff --git a/bff/gapi/rpc_delete_person.go b/bff/gapi/rpc_delete_person.go index 968f62e..2d43878 100644 --- a/bff/gapi/rpc_delete_person.go +++ b/bff/gapi/rpc_delete_person.go @@ -44,10 +44,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ return nil, status.Errorf(codes.Internal, "failed to get person") } - personID := int64(person.ID) - accountID := int64(account.ID) - - if person.AccountID != accountID { + if person.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "person not found") } @@ -60,7 +57,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ } rsp := &pb.DeletePersonResponse{ - Id: personID, + Id: person.ID, Deleted: true, } return rsp, nil diff --git a/bff/gapi/rpc_get_payment.go b/bff/gapi/rpc_get_payment.go index 08cf18c..ed72d10 100644 --- a/bff/gapi/rpc_get_payment.go +++ b/bff/gapi/rpc_get_payment.go @@ -44,9 +44,7 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) return nil, status.Error(codes.NotFound, "failed to get payments") } - accountID := int64(account.ID) - - if accountID != payment.AccountID { + if account.ID != payment.AccountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } diff --git a/bff/gapi/rpc_get_person.go b/bff/gapi/rpc_get_person.go index 6439a90..7687a39 100644 --- a/bff/gapi/rpc_get_person.go +++ b/bff/gapi/rpc_get_person.go @@ -44,9 +44,7 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( return nil, status.Error(codes.NotFound, "failed to get persons") } - accountID := int64(account.ID) - - if accountID != person.AccountID { + if account.ID != person.AccountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } diff --git a/bff/gapi/rpc_list_payments.go b/bff/gapi/rpc_list_payments.go index 124987f..2f262f4 100644 --- a/bff/gapi/rpc_list_payments.go +++ b/bff/gapi/rpc_list_payments.go @@ -42,9 +42,7 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ } } - accountID := int64(account.ID) - - dbPayments, err := server.store.ListPayments(ctx, accountID) + dbPayments, err := server.store.ListPayments(ctx, account.ID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") diff --git a/bff/gapi/rpc_list_persons.go b/bff/gapi/rpc_list_persons.go index 129fc9b..dc28a37 100644 --- a/bff/gapi/rpc_list_persons.go +++ b/bff/gapi/rpc_list_persons.go @@ -42,9 +42,7 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques } } - accountID := int64(account.ID) - - dbPersons, err := server.store.ListPersons(ctx, accountID) + dbPersons, err := server.store.ListPersons(ctx, account.ID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") diff --git a/bff/gapi/rpc_update_payment.go b/bff/gapi/rpc_update_payment.go index b892d81..40d8e47 100644 --- a/bff/gapi/rpc_update_payment.go +++ b/bff/gapi/rpc_update_payment.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -46,9 +47,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe return nil, status.Error(codes.Internal, "failed to get payment") } - accountID := int64(account.ID) - - if dbPayment.AccountID != accountID { + if dbPayment.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "payment not found") } @@ -93,6 +92,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe payment, err := server.store.UpdatePayment(ctx, arg) if err != nil { + slog.Error("Update Payment", slog.Int64("id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update payment") } diff --git a/bff/pb/rpc_delete_payment.pb.go b/bff/pb/rpc_delete_payment.pb.go index 2ca05c5..4cc13af 100644 --- a/bff/pb/rpc_delete_payment.pb.go +++ b/bff/pb/rpc_delete_payment.pb.go @@ -73,8 +73,8 @@ type DeletePaymentResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` } func (x *DeletePaymentResponse) Reset() { @@ -109,7 +109,7 @@ func (*DeletePaymentResponse) Descriptor() ([]byte, []int) { return file_rpc_delete_payment_proto_rawDescGZIP(), []int{1} } -func (x *DeletePaymentResponse) GetId() int64 { +func (x *DeletePaymentResponse) GetId() uint64 { if x != nil { return x.Id } @@ -139,7 +139,7 @@ var file_rpc_delete_payment_proto_rawDesc = []byte{ 0x01, 0x02, 0x69, 0x64, 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x7d, 0x22, 0x7f, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x3a, 0x3c, 0x92, 0x41, 0x39, 0x0a, 0x19, 0x2a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, 0x65, 0x73, 0x70, diff --git a/bff/pb/rpc_delete_person.pb.go b/bff/pb/rpc_delete_person.pb.go index 15abbbd..333b791 100644 --- a/bff/pb/rpc_delete_person.pb.go +++ b/bff/pb/rpc_delete_person.pb.go @@ -73,8 +73,8 @@ type DeletePersonResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` } func (x *DeletePersonResponse) Reset() { @@ -109,7 +109,7 @@ func (*DeletePersonResponse) Descriptor() ([]byte, []int) { return file_rpc_delete_person_proto_rawDescGZIP(), []int{1} } -func (x *DeletePersonResponse) GetId() int64 { +func (x *DeletePersonResponse) GetId() uint64 { if x != nil { return x.Id } @@ -139,7 +139,7 @@ var file_rpc_delete_person_proto_rawDesc = []byte{ 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x7d, 0x22, 0x7d, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x3a, 0x3b, 0x92, 0x41, 0x38, 0x0a, 0x18, 0x2a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x1c, diff --git a/bff/proto/rpc_delete_payment.proto b/bff/proto/rpc_delete_payment.proto index 7e01512..f8a2ba6 100644 --- a/bff/proto/rpc_delete_payment.proto +++ b/bff/proto/rpc_delete_payment.proto @@ -27,6 +27,6 @@ message DeletePaymentResponse { }; example: "{\"id\": \"1\", \"deleted\": true}" }; - int64 id = 1; + uint64 id = 1; bool deleted = 2; } \ No newline at end of file diff --git a/bff/proto/rpc_delete_person.proto b/bff/proto/rpc_delete_person.proto index 5f7345f..1d15bbe 100644 --- a/bff/proto/rpc_delete_person.proto +++ b/bff/proto/rpc_delete_person.proto @@ -27,6 +27,6 @@ message DeletePersonResponse { }; example: "{\"id\": \"1\", \"deleted\": true}" }; - int64 id = 1; + uint64 id = 1; bool deleted = 2; } \ No newline at end of file diff --git a/bff/sqlc.yaml b/bff/sqlc.yaml index 92a4550..9fcc26c 100644 --- a/bff/sqlc.yaml +++ b/bff/sqlc.yaml @@ -15,8 +15,19 @@ sql: overrides: - db_type: "bigserial" go_type: "uint64" - - db_type: "bigint" - null: false + - column: "payments.account_id" + go_type: "uint64" + - column: "persons.account_id" + go_type: "uint64" + - column: "documents.account_id" + go_type: "uint64" + - column: "returnsLog.return_id" + go_type: "uint64" + - column: "returnsLog.mail_id" + go_type: "uint64" + - column: "returns.provider_id" + go_type: "uint64" + - column: "returns.person_id" go_type: "uint64" - db_type: "timestamptz" go_type: "time.Time" From 15ce1302472cfe643e09d035330569caa3b4d2f7 Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 10 Oct 2023 00:46:21 +0200 Subject: [PATCH 07/15] ft/adds returns_log_by_person_id --- bff/db/migration/000001_init_schema.up.sql | 4 +- bff/db/mock/store.go | 15 + bff/db/query/returnsLog.sql | 7 + bff/db/sqlc/models.go | 16 +- bff/db/sqlc/querier.go | 1 + bff/db/sqlc/returnsLog.sql.go | 48 ++- bff/db/sqlc/returnsLog_test.go | 7 +- bff/doc/swagger/df.swagger.json | 105 +++++ bff/gapi/converter.go | 13 + bff/gapi/rpc_list_returns_log_by_person_id.go | 71 ++++ bff/pb/returns_log.pb.go | 255 +++++++++++ .../rpc_list_returns_log_by_person_id.pb.go | 227 ++++++++++ bff/pb/service_df.pb.go | 397 +++++++++--------- bff/pb/service_df.pb.gw.go | 103 +++++ bff/pb/service_df_grpc.pb.go | 37 ++ bff/proto/returns_log.proto | 29 ++ .../rpc_list_returns_log_by_person_id.proto | 34 ++ bff/proto/service_df.proto | 14 + 18 files changed, 1174 insertions(+), 209 deletions(-) create mode 100644 bff/gapi/rpc_list_returns_log_by_person_id.go create mode 100644 bff/pb/returns_log.pb.go create mode 100644 bff/pb/rpc_list_returns_log_by_person_id.pb.go create mode 100644 bff/proto/returns_log.proto create mode 100644 bff/proto/rpc_list_returns_log_by_person_id.proto diff --git a/bff/db/migration/000001_init_schema.up.sql b/bff/db/migration/000001_init_schema.up.sql index 8a3204d..48e12d8 100644 --- a/bff/db/migration/000001_init_schema.up.sql +++ b/bff/db/migration/000001_init_schema.up.sql @@ -114,7 +114,7 @@ CREATE TABLE "returns" ( "description" text NOT NULL, "category" varchar NOT NULL, "email" varchar NOT NULL, - "status" varchar NOT NULL, + "status" varchar NOT NULL DEFAULT "created", "creator" varchar NOT NULL, "created" timestamptz NOT NULL DEFAULT (now()), "changer" varchar NOT NULL, @@ -125,7 +125,7 @@ CREATE TABLE "returnsLog" ( "id" bigserial UNIQUE PRIMARY KEY NOT NULL, "return_id" bigint NOT NULL, "mail_id" bigint NOT NULL, - "status" varchar, + "status" varchar NOT NULL DEFAULT "created", "creator" varchar NOT NULL, "created" timestamptz NOT NULL DEFAULT (now()), "changer" varchar NOT NULL, diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index e102dcc..6d7af15 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -689,6 +689,21 @@ func (mr *MockStoreMockRecorder) ListReturnsLogs(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListReturnsLogs", reflect.TypeOf((*MockStore)(nil).ListReturnsLogs), arg0, arg1) } +// ListReturnsLogsByPersonID mocks base method. +func (m *MockStore) ListReturnsLogsByPersonID(arg0 context.Context, arg1 uint64) ([]db.ReturnsLog, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListReturnsLogsByPersonID", arg0, arg1) + ret0, _ := ret[0].([]db.ReturnsLog) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListReturnsLogsByPersonID indicates an expected call of ListReturnsLogsByPersonID. +func (mr *MockStoreMockRecorder) ListReturnsLogsByPersonID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListReturnsLogsByPersonID", reflect.TypeOf((*MockStore)(nil).ListReturnsLogsByPersonID), arg0, arg1) +} + // ListSessions mocks base method. func (m *MockStore) ListSessions(arg0 context.Context, arg1 string) ([]db.Session, error) { m.ctrl.T.Helper() diff --git a/bff/db/query/returnsLog.sql b/bff/db/query/returnsLog.sql index f6bcbe4..ea259de 100644 --- a/bff/db/query/returnsLog.sql +++ b/bff/db/query/returnsLog.sql @@ -23,6 +23,13 @@ ORDER BY "status" LIMIT $1 OFFSET $2; +-- name: ListReturnsLogsByPersonID :many +SELECT rl.* +FROM "returns" AS r +INNER JOIN "returnsLog" AS rl + ON r.id = rl.return_id +WHERE r.person_id = sqlc.arg(id); + -- name: UpdateReturnsLog :one UPDATE "returnsLog" SET diff --git a/bff/db/sqlc/models.go b/bff/db/sqlc/models.go index 57f9915..7455b7d 100644 --- a/bff/db/sqlc/models.go +++ b/bff/db/sqlc/models.go @@ -124,14 +124,14 @@ type Return struct { } type ReturnsLog struct { - ID uint64 `json:"id"` - ReturnID uint64 `json:"return_id"` - MailID uint64 `json:"mail_id"` - Status sql.NullString `json:"status"` - Creator string `json:"creator"` - Created time.Time `json:"created"` - Changer string `json:"changer"` - Changed time.Time `json:"changed"` + ID uint64 `json:"id"` + ReturnID uint64 `json:"return_id"` + MailID uint64 `json:"mail_id"` + Status string `json:"status"` + Creator string `json:"creator"` + Created time.Time `json:"created"` + Changer string `json:"changer"` + Changed time.Time `json:"changed"` } type Session struct { diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index 91dddfc..ab09380 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -65,6 +65,7 @@ type Querier interface { ListProviders(ctx context.Context, arg ListProvidersParams) ([]Provider, error) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams) ([]ReturnsLog, error) + ListReturnsLogsByPersonID(ctx context.Context, id uint64) ([]ReturnsLog, error) ListSessions(ctx context.Context, email string) ([]Session, error) UpdateAccount(ctx context.Context, arg UpdateAccountParams) (Account, error) UpdateAccountPrivacy(ctx context.Context, arg UpdateAccountPrivacyParams) (Account, error) diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index 380feee..b235330 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -27,10 +27,10 @@ INSERT INTO "returnsLog" ( ` type CreateReturnsLogParams struct { - ReturnID uint64 `json:"return_id"` - MailID uint64 `json:"mail_id"` - Status sql.NullString `json:"status"` - Creator string `json:"creator"` + ReturnID uint64 `json:"return_id"` + MailID uint64 `json:"mail_id"` + Status string `json:"status"` + Creator string `json:"creator"` } func (q *Queries) CreateReturnsLog(ctx context.Context, arg CreateReturnsLogParams) (ReturnsLog, error) { @@ -129,6 +129,46 @@ func (q *Queries) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams return items, nil } +const listReturnsLogsByPersonID = `-- name: ListReturnsLogsByPersonID :many +SELECT rl.id, rl.return_id, rl.mail_id, rl.status, rl.creator, rl.created, rl.changer, rl.changed +FROM "returns" AS r +INNER JOIN "returnsLog" AS rl + ON r.id = rl.return_id +WHERE r.person_id = $1 +` + +func (q *Queries) ListReturnsLogsByPersonID(ctx context.Context, id uint64) ([]ReturnsLog, error) { + rows, err := q.db.QueryContext(ctx, listReturnsLogsByPersonID, id) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ReturnsLog{} + for rows.Next() { + var i ReturnsLog + if err := rows.Scan( + &i.ID, + &i.ReturnID, + &i.MailID, + &i.Status, + &i.Creator, + &i.Created, + &i.Changer, + &i.Changed, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const updateReturnsLog = `-- name: UpdateReturnsLog :one UPDATE "returnsLog" SET diff --git a/bff/db/sqlc/returnsLog_test.go b/bff/db/sqlc/returnsLog_test.go index 30beeee..9df4811 100644 --- a/bff/db/sqlc/returnsLog_test.go +++ b/bff/db/sqlc/returnsLog_test.go @@ -20,11 +20,8 @@ func createRandomReturnsLog(t *testing.T) ReturnsLog { arg := CreateReturnsLogParams{ ReturnID: ret.ID, MailID: mail.ID, - Status: sql.NullString{ - Valid: true, - String: util.RandomString(7), - }, - Creator: creator, + Status: util.RandomString(7), + Creator: creator, } returnsLog, err := testQueries.CreateReturnsLog(context.Background(), arg) diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index a4135a5..9bf2aa2 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -577,6 +577,42 @@ ] } }, + "/v1/returns_log/list_returns_log/{personId}": { + "get": { + "operationId": "df_ListReturnsLog", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListReturnsLogResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "personId", + "in": "path", + "required": true, + "type": "string", + "format": "uint64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/sessions/block_session": { "patch": { "operationId": "df_BlockSession", @@ -1112,6 +1148,20 @@ "description": "Returns the Person", "title": "ListPersons Response" }, + "pbListReturnsLogResponse": { + "type": "object", + "properties": { + "returnsLog": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbReturnsLog" + } + } + }, + "description": "Returns the ReturnsLog", + "title": "ListReturnsLog Response" + }, "pbListSessionsResponse": { "type": "object", "properties": { @@ -1357,6 +1407,61 @@ }, "title": "Refresh Token Response" }, + "pbReturnsLog": { + "type": "object", + "example": { + "id": "1", + "email": "john.doe@example.com", + "firstname": "John", + "lastname": "Doe", + "phone": "", + "street": "Death Star 2", + "zip": "0815", + "city": "New York", + "country": "USA", + "birthday": "1990-10-05T00:00:00Z", + "privacy_accepted": false, + "privacy_accepted_date": "0001-01-01T00:00:00Z", + "creator": "john.doe@example.com", + "created": "2023-10-05T02:30:53Z", + "changer": "john.doe@example.com", + "changed": "2023-10-05T02:30:53Z" + }, + "properties": { + "id": { + "type": "string", + "format": "uint64" + }, + "returnId": { + "type": "string", + "format": "uint64" + }, + "mailId": { + "type": "string", + "format": "uint64" + }, + "status": { + "type": "string" + }, + "creator": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + }, + "changer": { + "type": "string" + }, + "changed": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + } + }, + "title": "ReturnsLog" + }, "pbSession": { "type": "object", "example": { diff --git a/bff/gapi/converter.go b/bff/gapi/converter.go index bc2a05e..a314e2d 100644 --- a/bff/gapi/converter.go +++ b/bff/gapi/converter.go @@ -77,3 +77,16 @@ func convertPayment(payment db.Payment) *pb.Payment { Changed: timestamppb.New(payment.Changed), } } + +func convertReturnsLog(returnsLog db.ReturnsLog) *pb.ReturnsLog { + return &pb.ReturnsLog{ + Id: returnsLog.ID, + ReturnId: returnsLog.ReturnID, + MailId: returnsLog.MailID, + Status: returnsLog.Status, + Creator: returnsLog.Creator, + Changer: returnsLog.Changer, + Created: timestamppb.New(returnsLog.Created), + Changed: timestamppb.New(returnsLog.Changed), + } +} diff --git a/bff/gapi/rpc_list_returns_log_by_person_id.go b/bff/gapi/rpc_list_returns_log_by_person_id.go new file mode 100644 index 0000000..6a5b3fa --- /dev/null +++ b/bff/gapi/rpc_list_returns_log_by_person_id.go @@ -0,0 +1,71 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) ListReturnsLog(ctx context.Context, req *pb.ListReturnsLogRequest) (*pb.ListReturnsLogResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateListReturnsLogRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + // if account.ID != req.GetPersonId() { + // if !server.isAdmin(ctx, authPayload) { + // return nil, status.Error(codes.NotFound, "account not found") + // } + // } + + dbReturnsLog, err := server.store.ListReturnsLogsByPersonID(ctx, req.GetPersonId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Error(codes.NotFound, "no returns_logs found") + } + return nil, status.Error(codes.NotFound, "failed to get returns_logs") + } + + var returns_logs []*pb.ReturnsLog + for _, a := range dbReturnsLog { + returns_logs = append(returns_logs, convertReturnsLog(a)) + } + + rsp := &pb.ListReturnsLogResponse{ + ReturnsLog: returns_logs, + } + + return rsp, nil +} + +func validateListReturnsLogRequest(req *pb.ListReturnsLogRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetPersonId() < 1 { + violations = append(violations, fieldViolation("account_id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/pb/returns_log.pb.go b/bff/pb/returns_log.pb.go new file mode 100644 index 0000000..ee638da --- /dev/null +++ b/bff/pb/returns_log.pb.go @@ -0,0 +1,255 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: returns_log.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ReturnsLog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ReturnId uint64 `protobuf:"varint,2,opt,name=return_id,json=returnId,proto3" json:"return_id,omitempty"` + MailId uint64 `protobuf:"varint,3,opt,name=mail_id,json=mailId,proto3" json:"mail_id,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Creator string `protobuf:"bytes,5,opt,name=creator,proto3" json:"creator,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created,proto3" json:"created,omitempty"` + Changer string `protobuf:"bytes,7,opt,name=changer,proto3" json:"changer,omitempty"` + Changed *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=changed,proto3" json:"changed,omitempty"` +} + +func (x *ReturnsLog) Reset() { + *x = ReturnsLog{} + if protoimpl.UnsafeEnabled { + mi := &file_returns_log_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReturnsLog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReturnsLog) ProtoMessage() {} + +func (x *ReturnsLog) ProtoReflect() protoreflect.Message { + mi := &file_returns_log_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReturnsLog.ProtoReflect.Descriptor instead. +func (*ReturnsLog) Descriptor() ([]byte, []int) { + return file_returns_log_proto_rawDescGZIP(), []int{0} +} + +func (x *ReturnsLog) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ReturnsLog) GetReturnId() uint64 { + if x != nil { + return x.ReturnId + } + return 0 +} + +func (x *ReturnsLog) GetMailId() uint64 { + if x != nil { + return x.MailId + } + return 0 +} + +func (x *ReturnsLog) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ReturnsLog) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *ReturnsLog) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *ReturnsLog) GetChanger() string { + if x != nil { + return x.Changer + } + return "" +} + +func (x *ReturnsLog) GetChanged() *timestamppb.Timestamp { + if x != nil { + return x.Changed + } + return nil +} + +var File_returns_log_proto protoreflect.FileDescriptor + +var file_returns_log_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x06, 0x0a, 0x0a, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x72, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x51, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, + 0x18, 0x4a, 0x16, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, + 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x07, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, + 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, + 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x3a, + 0xc0, 0x03, 0x92, 0x41, 0xbc, 0x03, 0x0a, 0x0c, 0x2a, 0x0a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x4c, 0x6f, 0x67, 0x32, 0xab, 0x03, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, + 0x22, 0x2c, 0x22, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, + 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x22, 0x2c, 0x20, 0x22, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, + 0x22, 0x4a, 0x6f, 0x68, 0x6e, 0x22, 0x2c, 0x20, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x6f, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, + 0x3a, 0x20, 0x22, 0x44, 0x65, 0x61, 0x74, 0x68, 0x20, 0x53, 0x74, 0x61, 0x72, 0x20, 0x32, 0x22, + 0x2c, 0x20, 0x22, 0x7a, 0x69, 0x70, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x38, 0x31, 0x35, 0x22, 0x2c, + 0x20, 0x22, 0x63, 0x69, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x4e, 0x65, 0x77, 0x20, 0x59, 0x6f, + 0x72, 0x6b, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x3a, 0x20, + 0x22, 0x55, 0x53, 0x41, 0x22, 0x2c, 0x20, 0x22, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, + 0x22, 0x3a, 0x20, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, + 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x63, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x20, 0x22, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x61, + 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x30, 0x30, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, + 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, + 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, + 0x54, 0x30, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x35, 0x33, 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x72, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, + 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, + 0x22, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, + 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x35, 0x33, 0x5a, + 0x22, 0x7d, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_returns_log_proto_rawDescOnce sync.Once + file_returns_log_proto_rawDescData = file_returns_log_proto_rawDesc +) + +func file_returns_log_proto_rawDescGZIP() []byte { + file_returns_log_proto_rawDescOnce.Do(func() { + file_returns_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_returns_log_proto_rawDescData) + }) + return file_returns_log_proto_rawDescData +} + +var file_returns_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_returns_log_proto_goTypes = []interface{}{ + (*ReturnsLog)(nil), // 0: pb.ReturnsLog + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_returns_log_proto_depIdxs = []int32{ + 1, // 0: pb.ReturnsLog.created:type_name -> google.protobuf.Timestamp + 1, // 1: pb.ReturnsLog.changed:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_returns_log_proto_init() } +func file_returns_log_proto_init() { + if File_returns_log_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_returns_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReturnsLog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_returns_log_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_returns_log_proto_goTypes, + DependencyIndexes: file_returns_log_proto_depIdxs, + MessageInfos: file_returns_log_proto_msgTypes, + }.Build() + File_returns_log_proto = out.File + file_returns_log_proto_rawDesc = nil + file_returns_log_proto_goTypes = nil + file_returns_log_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_list_returns_log_by_person_id.pb.go b/bff/pb/rpc_list_returns_log_by_person_id.pb.go new file mode 100644 index 0000000..b0d204a --- /dev/null +++ b/bff/pb/rpc_list_returns_log_by_person_id.pb.go @@ -0,0 +1,227 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_list_returns_log_by_person_id.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListReturnsLogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PersonId uint64 `protobuf:"varint,1,opt,name=person_id,json=personId,proto3" json:"person_id,omitempty"` +} + +func (x *ListReturnsLogRequest) Reset() { + *x = ListReturnsLogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_returns_log_by_person_id_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReturnsLogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReturnsLogRequest) ProtoMessage() {} + +func (x *ListReturnsLogRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_returns_log_by_person_id_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReturnsLogRequest.ProtoReflect.Descriptor instead. +func (*ListReturnsLogRequest) Descriptor() ([]byte, []int) { + return file_rpc_list_returns_log_by_person_id_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReturnsLogRequest) GetPersonId() uint64 { + if x != nil { + return x.PersonId + } + return 0 +} + +type ListReturnsLogResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReturnsLog []*ReturnsLog `protobuf:"bytes,1,rep,name=returns_log,json=returnsLog,proto3" json:"returns_log,omitempty"` +} + +func (x *ListReturnsLogResponse) Reset() { + *x = ListReturnsLogResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_list_returns_log_by_person_id_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReturnsLogResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReturnsLogResponse) ProtoMessage() {} + +func (x *ListReturnsLogResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_list_returns_log_by_person_id_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReturnsLogResponse.ProtoReflect.Descriptor instead. +func (*ListReturnsLogResponse) Descriptor() ([]byte, []int) { + return file_rpc_list_returns_log_by_person_id_proto_rawDescGZIP(), []int{1} +} + +func (x *ListReturnsLogResponse) GetReturnsLog() []*ReturnsLog { + if x != nil { + return x.ReturnsLog + } + return nil +} + +var File_rpc_list_returns_log_by_person_id_proto protoreflect.FileDescriptor + +var file_rpc_list_returns_log_by_person_id_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x88, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x64, 0x3a, 0x52, 0x92, 0x41, 0x4f, 0x0a, 0x3a, 0x2a, 0x0e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x32, 0x1c, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, + 0x66, 0x20, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0xd2, 0x01, 0x09, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x32, 0x11, 0x7b, 0x22, 0x70, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x31, 0x20, 0x7d, 0x22, 0x86, 0x01, 0x0a, 0x16, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x42, 0x03, 0x92, 0x41, 0x00, + 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x3a, 0x36, 0x92, 0x41, + 0x33, 0x0a, 0x31, 0x2a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x4c, 0x6f, 0x67, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x16, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x4c, 0x6f, 0x67, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_list_returns_log_by_person_id_proto_rawDescOnce sync.Once + file_rpc_list_returns_log_by_person_id_proto_rawDescData = file_rpc_list_returns_log_by_person_id_proto_rawDesc +) + +func file_rpc_list_returns_log_by_person_id_proto_rawDescGZIP() []byte { + file_rpc_list_returns_log_by_person_id_proto_rawDescOnce.Do(func() { + file_rpc_list_returns_log_by_person_id_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_list_returns_log_by_person_id_proto_rawDescData) + }) + return file_rpc_list_returns_log_by_person_id_proto_rawDescData +} + +var file_rpc_list_returns_log_by_person_id_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_list_returns_log_by_person_id_proto_goTypes = []interface{}{ + (*ListReturnsLogRequest)(nil), // 0: pb.ListReturnsLogRequest + (*ListReturnsLogResponse)(nil), // 1: pb.ListReturnsLogResponse + (*ReturnsLog)(nil), // 2: pb.ReturnsLog +} +var file_rpc_list_returns_log_by_person_id_proto_depIdxs = []int32{ + 2, // 0: pb.ListReturnsLogResponse.returns_log:type_name -> pb.ReturnsLog + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_list_returns_log_by_person_id_proto_init() } +func file_rpc_list_returns_log_by_person_id_proto_init() { + if File_rpc_list_returns_log_by_person_id_proto != nil { + return + } + file_returns_log_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_list_returns_log_by_person_id_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReturnsLogRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_list_returns_log_by_person_id_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReturnsLogResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_list_returns_log_by_person_id_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_list_returns_log_by_person_id_proto_goTypes, + DependencyIndexes: file_rpc_list_returns_log_by_person_id_proto_depIdxs, + MessageInfos: file_rpc_list_returns_log_by_person_id_proto_msgTypes, + }.Build() + File_rpc_list_returns_log_by_person_id_proto = out.File + file_rpc_list_returns_log_by_person_id_proto_rawDesc = nil + file_rpc_list_returns_log_by_person_id_proto_goTypes = nil + file_rpc_list_returns_log_by_person_id_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index 2ced52a..d949e3a 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -55,163 +55,175 @@ var file_service_df_proto_rawDesc = []byte{ 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, - 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, - 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xd4, 0x11, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, - 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, - 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, - 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x72, 0x70, 0x63, 0x5f, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, + 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe9, 0x12, + 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, + 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, - 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, - 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, - 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, - 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, - 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, - 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, - 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, - 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, + 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, + 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, - 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, - 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, - 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, - 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, - 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, + 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, + 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, + 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, + 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, + 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, + 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, + 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, + 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x92, 0x01, 0x0a, 0x0e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, + 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, + 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, + 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, + 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, + 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, + 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, + 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, + 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -233,24 +245,26 @@ var file_service_df_proto_goTypes = []interface{}{ (*DeletePaymentRequest)(nil), // 15: pb.DeletePaymentRequest (*ListPaymentsRequest)(nil), // 16: pb.ListPaymentsRequest (*UpdatePaymentRequest)(nil), // 17: pb.UpdatePaymentRequest - (*LoginResponse)(nil), // 18: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 19: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 20: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 21: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 22: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 23: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 24: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 25: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 26: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 27: pb.CreatePersonResponse - (*GetPersonResponse)(nil), // 28: pb.GetPersonResponse - (*DeletePersonResponse)(nil), // 29: pb.DeletePersonResponse - (*ListPersonsResponse)(nil), // 30: pb.ListPersonsResponse - (*CreatePaymentResponse)(nil), // 31: pb.CreatePaymentResponse - (*GetPaymentResponse)(nil), // 32: pb.GetPaymentResponse - (*DeletePaymentResponse)(nil), // 33: pb.DeletePaymentResponse - (*ListPaymentsResponse)(nil), // 34: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 35: pb.UpdatePaymentResponse + (*ListReturnsLogRequest)(nil), // 18: pb.ListReturnsLogRequest + (*LoginResponse)(nil), // 19: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 20: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 21: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 22: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 23: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 24: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 25: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 26: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 27: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 28: pb.CreatePersonResponse + (*GetPersonResponse)(nil), // 29: pb.GetPersonResponse + (*DeletePersonResponse)(nil), // 30: pb.DeletePersonResponse + (*ListPersonsResponse)(nil), // 31: pb.ListPersonsResponse + (*CreatePaymentResponse)(nil), // 32: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 33: pb.GetPaymentResponse + (*DeletePaymentResponse)(nil), // 34: pb.DeletePaymentResponse + (*ListPaymentsResponse)(nil), // 35: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 36: pb.UpdatePaymentResponse + (*ListReturnsLogResponse)(nil), // 37: pb.ListReturnsLogResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -271,26 +285,28 @@ var file_service_df_proto_depIdxs = []int32{ 15, // 15: pb.df.DeletePayment:input_type -> pb.DeletePaymentRequest 16, // 16: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest 17, // 17: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest - 18, // 18: pb.df.Login:output_type -> pb.LoginResponse - 19, // 19: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 20, // 20: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 21, // 21: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 22, // 22: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 23, // 23: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 24, // 24: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 25, // 25: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 26, // 26: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 27, // 27: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 28, // 28: pb.df.GetPerson:output_type -> pb.GetPersonResponse - 29, // 29: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse - 30, // 30: pb.df.ListPersons:output_type -> pb.ListPersonsResponse - 31, // 31: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 32, // 32: pb.df.GetPayment:output_type -> pb.GetPaymentResponse - 33, // 33: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse - 34, // 34: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 35, // 35: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 18, // [18:36] is the sub-list for method output_type - 0, // [0:18] is the sub-list for method input_type + 18, // 18: pb.df.ListReturnsLog:input_type -> pb.ListReturnsLogRequest + 19, // 19: pb.df.Login:output_type -> pb.LoginResponse + 20, // 20: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 21, // 21: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 22, // 22: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 23, // 23: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 24, // 24: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 25, // 25: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 26, // 26: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 27, // 27: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 28, // 28: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 29, // 29: pb.df.GetPerson:output_type -> pb.GetPersonResponse + 30, // 30: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse + 31, // 31: pb.df.ListPersons:output_type -> pb.ListPersonsResponse + 32, // 32: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 33, // 33: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 34, // 34: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse + 35, // 35: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 36, // 36: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 37, // 37: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse + 19, // [19:38] is the sub-list for method output_type + 0, // [0:19] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -317,6 +333,7 @@ func file_service_df_proto_init() { file_rpc_list_sessions_proto_init() file_rpc_block_session_proto_init() file_rpc_update_account_privacy_proto_init() + file_rpc_list_returns_log_by_person_id_proto_init() file_rpc_login_proto_init() file_rpc_refresh_token_proto_init() type x struct{} diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 37cf0ae..71dddfc 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -789,6 +789,58 @@ func local_request_Df_UpdatePayment_0(ctx context.Context, marshaler runtime.Mar } +func request_Df_ListReturnsLog_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReturnsLogRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["person_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "person_id") + } + + protoReq.PersonId, err = runtime.Uint64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "person_id", err) + } + + msg, err := client.ListReturnsLog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_ListReturnsLog_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReturnsLogRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["person_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "person_id") + } + + protoReq.PersonId, err = runtime.Uint64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "person_id", err) + } + + msg, err := server.ListReturnsLog(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDfHandlerServer registers the http handlers for service Df to "mux". // UnaryRPC :call DfServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1245,6 +1297,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("GET", pattern_Df_ListReturnsLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/ListReturnsLog", runtime.WithHTTPPathPattern("/v1/returns_log/list_returns_log/{person_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_ListReturnsLog_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListReturnsLog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1682,6 +1759,28 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("GET", pattern_Df_ListReturnsLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/ListReturnsLog", runtime.WithHTTPPathPattern("/v1/returns_log/list_returns_log/{person_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_ListReturnsLog_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_ListReturnsLog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1721,6 +1820,8 @@ var ( pattern_Df_ListPayments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payments", "list_payments", "account_id"}, "")) pattern_Df_UpdatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "update_payment"}, "")) + + pattern_Df_ListReturnsLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "returns_log", "list_returns_log", "person_id"}, "")) ) var ( @@ -1759,4 +1860,6 @@ var ( forward_Df_ListPayments_0 = runtime.ForwardResponseMessage forward_Df_UpdatePayment_0 = runtime.ForwardResponseMessage + + forward_Df_ListReturnsLog_0 = runtime.ForwardResponseMessage ) diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index 6f970f8..fecdd23 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -37,6 +37,7 @@ const ( Df_DeletePayment_FullMethodName = "/pb.df/DeletePayment" Df_ListPayments_FullMethodName = "/pb.df/ListPayments" Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" + Df_ListReturnsLog_FullMethodName = "/pb.df/ListReturnsLog" ) // DfClient is the client API for Df service. @@ -61,6 +62,7 @@ type DfClient interface { DeletePayment(ctx context.Context, in *DeletePaymentRequest, opts ...grpc.CallOption) (*DeletePaymentResponse, error) ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) + ListReturnsLog(ctx context.Context, in *ListReturnsLogRequest, opts ...grpc.CallOption) (*ListReturnsLogResponse, error) } type dfClient struct { @@ -233,6 +235,15 @@ func (c *dfClient) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, return out, nil } +func (c *dfClient) ListReturnsLog(ctx context.Context, in *ListReturnsLogRequest, opts ...grpc.CallOption) (*ListReturnsLogResponse, error) { + out := new(ListReturnsLogResponse) + err := c.cc.Invoke(ctx, Df_ListReturnsLog_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DfServer is the server API for Df service. // All implementations must embed UnimplementedDfServer // for forward compatibility @@ -255,6 +266,7 @@ type DfServer interface { DeletePayment(context.Context, *DeletePaymentRequest) (*DeletePaymentResponse, error) ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) + ListReturnsLog(context.Context, *ListReturnsLogRequest) (*ListReturnsLogResponse, error) mustEmbedUnimplementedDfServer() } @@ -316,6 +328,9 @@ func (UnimplementedDfServer) ListPayments(context.Context, *ListPaymentsRequest) func (UnimplementedDfServer) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdatePayment not implemented") } +func (UnimplementedDfServer) ListReturnsLog(context.Context, *ListReturnsLogRequest) (*ListReturnsLogResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListReturnsLog not implemented") +} func (UnimplementedDfServer) mustEmbedUnimplementedDfServer() {} // UnsafeDfServer may be embedded to opt out of forward compatibility for this service. @@ -653,6 +668,24 @@ func _Df_UpdatePayment_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Df_ListReturnsLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReturnsLogRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).ListReturnsLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_ListReturnsLog_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).ListReturnsLog(ctx, req.(*ListReturnsLogRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Df_ServiceDesc is the grpc.ServiceDesc for Df service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -732,6 +765,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdatePayment", Handler: _Df_UpdatePayment_Handler, }, + { + MethodName: "ListReturnsLog", + Handler: _Df_ListReturnsLog_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_df.proto", diff --git a/bff/proto/returns_log.proto b/bff/proto/returns_log.proto new file mode 100644 index 0000000..378fa96 --- /dev/null +++ b/bff/proto/returns_log.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message ReturnsLog { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ReturnsLog"; + }; + example: "{\"id\": \"1\",\"email\": \"john.doe@example.com\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"phone\": \"\", \"street\": \"Death Star 2\", \"zip\": \"0815\", \"city\": \"New York\", \"country\": \"USA\", \"birthday\": \"1990-10-05T00:00:00Z\", \"privacy_accepted\": false, \"privacy_accepted_date\": \"0001-01-01T00:00:00Z\", \"creator\": \"john.doe@example.com\", \"created\": \"2023-10-05T02:30:53Z\", \"changer\": \"john.doe@example.com\", \"changed\": \"2023-10-05T02:30:53Z\"}"; + }; + uint64 id = 1; + uint64 return_id = 2; + uint64 mail_id = 3; + string status = 4; + string creator = 5; + google.protobuf.Timestamp created = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; + string changer = 7; + google.protobuf.Timestamp changed = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; +} \ No newline at end of file diff --git a/bff/proto/rpc_list_returns_log_by_person_id.proto b/bff/proto/rpc_list_returns_log_by_person_id.proto new file mode 100644 index 0000000..8cb5c94 --- /dev/null +++ b/bff/proto/rpc_list_returns_log_by_person_id.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "returns_log.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message ListReturnsLogRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListReturnsLog"; + description: "Returns a List of ReturnsLog"; + required: [ + "person_id" + ]; + }; + example: "{\"person_id\": 1 }"; + }; + uint64 person_id = 1; +} + +message ListReturnsLogResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "ListReturnsLog Response"; + description: "Returns the ReturnsLog"; + }; + }; + repeated ReturnsLog returns_log = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index 39d4120..c532125 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -21,6 +21,7 @@ import "rpc_list_payments.proto"; import "rpc_list_sessions.proto"; import "rpc_block_session.proto"; import "rpc_update_account_privacy.proto"; +import "rpc_list_returns_log_by_person_id.proto"; import "rpc_login.proto"; import "rpc_refresh_token.proto"; @@ -278,4 +279,17 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc ListReturnsLog (ListReturnsLogRequest) returns (ListReturnsLogResponse) { + option (google.api.http) = { + get: "/v1/returns_log/list_returns_log/{person_id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; }; \ No newline at end of file From 76b348f0ae9c13bb827ed301b3e4c12cdf1a684b Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 10 Oct 2023 00:51:41 +0200 Subject: [PATCH 08/15] fix/replaces double with single quotes --- bff/db/migration/000001_init_schema.up.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bff/db/migration/000001_init_schema.up.sql b/bff/db/migration/000001_init_schema.up.sql index 48e12d8..ef694b4 100644 --- a/bff/db/migration/000001_init_schema.up.sql +++ b/bff/db/migration/000001_init_schema.up.sql @@ -114,7 +114,7 @@ CREATE TABLE "returns" ( "description" text NOT NULL, "category" varchar NOT NULL, "email" varchar NOT NULL, - "status" varchar NOT NULL DEFAULT "created", + "status" varchar NOT NULL DEFAULT 'created', "creator" varchar NOT NULL, "created" timestamptz NOT NULL DEFAULT (now()), "changer" varchar NOT NULL, @@ -125,7 +125,7 @@ CREATE TABLE "returnsLog" ( "id" bigserial UNIQUE PRIMARY KEY NOT NULL, "return_id" bigint NOT NULL, "mail_id" bigint NOT NULL, - "status" varchar NOT NULL DEFAULT "created", + "status" varchar NOT NULL DEFAULT 'created', "creator" varchar NOT NULL, "created" timestamptz NOT NULL DEFAULT (now()), "changer" varchar NOT NULL, From 2b2e4e6dc89eb15e6b4637d70695434f0d18d88a Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 10 Oct 2023 02:41:29 +0200 Subject: [PATCH 09/15] ft/adds logs to all internal errors --- bff/gapi/rpc_block_session.go | 3 +++ bff/gapi/rpc_create_account.go | 3 +++ bff/gapi/rpc_create_payment.go | 3 +++ bff/gapi/rpc_create_person.go | 4 ++++ bff/gapi/rpc_delete_payment.go | 6 +++++- bff/gapi/rpc_delete_person.go | 4 ++++ bff/gapi/rpc_get_account.go | 2 ++ bff/gapi/rpc_get_payment.go | 3 +++ bff/gapi/rpc_get_person.go | 3 +++ bff/gapi/rpc_list_accounts.go | 2 ++ bff/gapi/rpc_list_payments.go | 3 +++ bff/gapi/rpc_list_persons.go | 3 +++ bff/gapi/rpc_list_returns_log_by_person_id.go | 3 +++ bff/gapi/rpc_list_sessions.go | 3 +++ bff/gapi/rpc_login.go | 6 ++++++ bff/gapi/rpc_refresh_token.go | 4 ++++ bff/gapi/rpc_update_account.go | 3 +++ bff/gapi/rpc_update_account_privacy.go | 3 +++ bff/gapi/rpc_update_payment.go | 4 +++- bff/gapi/server.go | 5 ++++- 20 files changed, 67 insertions(+), 3 deletions(-) diff --git a/bff/gapi/rpc_block_session.go b/bff/gapi/rpc_block_session.go index d41549c..5d1cd3d 100644 --- a/bff/gapi/rpc_block_session.go +++ b/bff/gapi/rpc_block_session.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/google/uuid" "github.com/itsscb/df/bff/pb" @@ -30,6 +31,7 @@ func (server *Server) BlockSession(ctx context.Context, req *pb.BlockSessionRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "session not found") } + slog.Error("block_session (get)", slog.String("invoked_by", authPayload.Email), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get session") } @@ -45,6 +47,7 @@ func (server *Server) BlockSession(ctx context.Context, req *pb.BlockSessionRequ err = server.store.BlockSession(ctx, uid) if err != nil { + slog.Error("block_session (db)", slog.String("invoked_by", authPayload.Email), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to block session") } diff --git a/bff/gapi/rpc_create_account.go b/bff/gapi/rpc_create_account.go index 901a6fb..1f65fe3 100644 --- a/bff/gapi/rpc_create_account.go +++ b/bff/gapi/rpc_create_account.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -22,6 +23,7 @@ func (server *Server) CreateAccount(ctx context.Context, req *pb.CreateAccountRe hashedPassword, err := util.HashPassword(req.GetPassword()) if err != nil { + slog.Error("create_account (hash_password)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to hash password: %s", err) } @@ -48,6 +50,7 @@ func (server *Server) CreateAccount(ctx context.Context, req *pb.CreateAccountRe account, err := server.store.CreateAccountTx(ctx, arg) if err != nil { + slog.Error("create_account (db)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create account") } diff --git a/bff/gapi/rpc_create_payment.go b/bff/gapi/rpc_create_payment.go index ea36c1f..ab62dd5 100644 --- a/bff/gapi/rpc_create_payment.go +++ b/bff/gapi/rpc_create_payment.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -29,6 +30,7 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("create_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get account") } @@ -72,6 +74,7 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe payment, err := server.store.CreatePayment(ctx, arg) if err != nil { + slog.Error("create_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("payment_category", req.GetPaymentCategory()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to create payment") } diff --git a/bff/gapi/rpc_create_person.go b/bff/gapi/rpc_create_person.go index 09c9d83..8979a19 100644 --- a/bff/gapi/rpc_create_person.go +++ b/bff/gapi/rpc_create_person.go @@ -4,6 +4,8 @@ import ( "context" "database/sql" "errors" + "fmt" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -29,6 +31,7 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("create_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get account") } @@ -53,6 +56,7 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ person, err := server.store.CreatePersonTx(ctx, arg) if err != nil { + slog.Error("create_person (db)", slog.String("invoked_by", authPayload.Email), slog.String("person", fmt.Sprintf("%s, %s", req.GetLastname(), req.GetFirstname())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to create person") } diff --git a/bff/gapi/rpc_delete_payment.go b/bff/gapi/rpc_delete_payment.go index 15b5f43..fbef65f 100644 --- a/bff/gapi/rpc_delete_payment.go +++ b/bff/gapi/rpc_delete_payment.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("delete_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -41,6 +43,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "payment not found") } + slog.Error("delete_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get payment") } @@ -52,7 +55,8 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe err = server.store.DeletePayment(ctx, req.GetId()) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to block payment") + slog.Error("delete_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Errorf(codes.Internal, "failed to delete payment") } diff --git a/bff/gapi/rpc_delete_person.go b/bff/gapi/rpc_delete_person.go index 2d43878..7fec68e 100644 --- a/bff/gapi/rpc_delete_person.go +++ b/bff/gapi/rpc_delete_person.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("delete_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -41,6 +43,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "person not found") } + slog.Error("delete_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get person") } @@ -52,6 +55,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ err = server.store.DeletePersonTx(ctx, person.ID) if err != nil { + slog.Error("delete_person (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to delete person") } diff --git a/bff/gapi/rpc_get_account.go b/bff/gapi/rpc_get_account.go index 5fde0bc..76b967a 100644 --- a/bff/gapi/rpc_get_account.go +++ b/bff/gapi/rpc_get_account.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) GetAccount(ctx context.Context, req *pb.GetAccountRequest) if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("get_account (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } diff --git a/bff/gapi/rpc_get_payment.go b/bff/gapi/rpc_get_payment.go index ed72d10..5291963 100644 --- a/bff/gapi/rpc_get_payment.go +++ b/bff/gapi/rpc_get_payment.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("get_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -41,6 +43,7 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") } + slog.Error("get_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get payments") } diff --git a/bff/gapi/rpc_get_person.go b/bff/gapi/rpc_get_person.go index 7687a39..339ef77 100644 --- a/bff/gapi/rpc_get_person.go +++ b/bff/gapi/rpc_get_person.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("get_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -41,6 +43,7 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") } + slog.Error("get_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get persons") } diff --git a/bff/gapi/rpc_list_accounts.go b/bff/gapi/rpc_list_accounts.go index bf38c03..1cc631c 100644 --- a/bff/gapi/rpc_list_accounts.go +++ b/bff/gapi/rpc_list_accounts.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -33,6 +34,7 @@ func (server *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no accounts found") } + slog.Error("list_accounts (db)", slog.String("invoked_by", authPayload.Email), slog.Int("page_id", int(req.GetPageId())), slog.Int("page_size", int(req.GetPageSize())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get accounts") } diff --git a/bff/gapi/rpc_list_payments.go b/bff/gapi/rpc_list_payments.go index 2f262f4..aa1e48e 100644 --- a/bff/gapi/rpc_list_payments.go +++ b/bff/gapi/rpc_list_payments.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("list_payments (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -47,6 +49,7 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") } + slog.Error("list_payments (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get payments") } diff --git a/bff/gapi/rpc_list_persons.go b/bff/gapi/rpc_list_persons.go index dc28a37..608c2fc 100644 --- a/bff/gapi/rpc_list_persons.go +++ b/bff/gapi/rpc_list_persons.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("list_persons (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -47,6 +49,7 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") } + slog.Error("list_persons (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get persons") } diff --git a/bff/gapi/rpc_list_returns_log_by_person_id.go b/bff/gapi/rpc_list_returns_log_by_person_id.go index 6a5b3fa..0e3d16d 100644 --- a/bff/gapi/rpc_list_returns_log_by_person_id.go +++ b/bff/gapi/rpc_list_returns_log_by_person_id.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) ListReturnsLog(ctx context.Context, req *pb.ListReturnsLog if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("list_returns_log_by_person_id (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -47,6 +49,7 @@ func (server *Server) ListReturnsLog(ctx context.Context, req *pb.ListReturnsLog if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no returns_logs found") } + slog.Error("list_returns_log_by_person_id (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get returns_logs") } diff --git a/bff/gapi/rpc_list_sessions.go b/bff/gapi/rpc_list_sessions.go index 4b2d8a8..7dadaa8 100644 --- a/bff/gapi/rpc_list_sessions.go +++ b/bff/gapi/rpc_list_sessions.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "github.com/itsscb/df/bff/pb" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -27,6 +28,7 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("list_sessions (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -47,6 +49,7 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no accounts found") } + slog.Error("list_sessions (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get accounts") } diff --git a/bff/gapi/rpc_login.go b/bff/gapi/rpc_login.go index ff55721..4cdf108 100644 --- a/bff/gapi/rpc_login.go +++ b/bff/gapi/rpc_login.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -27,6 +28,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi return nil, status.Error(codes.NotFound, "account not found") } + slog.Error("login (get_account)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -37,6 +39,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi id, err := server.tokenMaker.NewTokenID() if err != nil { + slog.Error("login (token_id)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create token id") } @@ -46,6 +49,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi server.config.RefreshTokenDuration, ) if err != nil { + slog.Error("login (refresh_token)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create refresh token") } @@ -56,6 +60,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi server.config.AccessTokenDuration, ) if err != nil { + slog.Error("login (access_token)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create access token") } @@ -71,6 +76,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi ExpiresAt: refreshPayload.ExpiredAt, }) if err != nil { + slog.Error("login (db)", slog.String("invoked_by", req.GetEmail()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create session") } diff --git a/bff/gapi/rpc_refresh_token.go b/bff/gapi/rpc_refresh_token.go index 55e7e23..8aa1f74 100644 --- a/bff/gapi/rpc_refresh_token.go +++ b/bff/gapi/rpc_refresh_token.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" "time" "github.com/itsscb/df/bff/pb" @@ -31,6 +32,7 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "session not found") } + slog.Error("refresh_token (get_account)", slog.String("invoked_by", refreshPayload.Email), slog.String("refresh_token", req.GetRefreshToken()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "cannot find session") } @@ -54,6 +56,7 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ id, err := server.tokenMaker.NewTokenID() if err != nil { + slog.Error("refresh_token (token_id)", slog.String("invoked_by", refreshPayload.Email), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create session token") } accessToken, accessPayload, err := server.tokenMaker.CreateToken( @@ -62,6 +65,7 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ server.config.AccessTokenDuration, ) if err != nil { + slog.Error("refresh_token (access_token)", slog.String("invoked_by", refreshPayload.Email), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create session token") } diff --git a/bff/gapi/rpc_update_account.go b/bff/gapi/rpc_update_account.go index 0cce5c5..53cab57 100644 --- a/bff/gapi/rpc_update_account.go +++ b/bff/gapi/rpc_update_account.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -75,6 +76,7 @@ func (server *Server) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRe if req.Password != nil { hashedPassword, err := util.HashPassword(req.GetPassword()) if err != nil { + slog.Error("update_account (hash_password)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to hash password") } @@ -86,6 +88,7 @@ func (server *Server) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRe account, err := server.store.UpdateAccountTx(ctx, arg) if err != nil { + slog.Error("update_account (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update account") } diff --git a/bff/gapi/rpc_update_account_privacy.go b/bff/gapi/rpc_update_account_privacy.go index d96ee7c..9df7a50 100644 --- a/bff/gapi/rpc_update_account_privacy.go +++ b/bff/gapi/rpc_update_account_privacy.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "errors" + "log/slog" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/pb" @@ -28,6 +29,7 @@ func (server *Server) UpdateAccountPrivacy(ctx context.Context, req *pb.UpdateAc if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("update_account_privacy (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get account") } @@ -46,6 +48,7 @@ func (server *Server) UpdateAccountPrivacy(ctx context.Context, req *pb.UpdateAc account, err = server.store.UpdateAccountPrivacyTx(ctx, arg) if err != nil { + slog.Error("update_account_privacy (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update account privacy") } diff --git a/bff/gapi/rpc_update_payment.go b/bff/gapi/rpc_update_payment.go index 40d8e47..d151ab1 100644 --- a/bff/gapi/rpc_update_payment.go +++ b/bff/gapi/rpc_update_payment.go @@ -30,6 +30,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } + slog.Error("update_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } @@ -44,6 +45,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "payment not found") } + slog.Error("update_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get payment") } @@ -92,7 +94,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe payment, err := server.store.UpdatePayment(ctx, arg) if err != nil { - slog.Error("Update Payment", slog.Int64("id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update payment") } diff --git a/bff/gapi/server.go b/bff/gapi/server.go index 912179b..9be8219 100644 --- a/bff/gapi/server.go +++ b/bff/gapi/server.go @@ -32,12 +32,15 @@ func NewServer(config util.Config, store db.Store) (*Server, error) { } logLevel := slog.LevelError + var logSource bool if config.Environment == "development" { logLevel = slog.LevelDebug + logSource = true } opts := slog.HandlerOptions{ - Level: logLevel, + Level: logLevel, + AddSource: logSource, } logger := slog.New(slog.NewTextHandler(os.Stdout, &opts)) From 1ece980939674ebda9a87aee8f0fb3e7309d2362 Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 10 Oct 2023 23:40:08 +0200 Subject: [PATCH 10/15] ft/adds endpoint & adss ft to tx adds update_person adds removal of documents, returnsLogs and returns to tx_delete_person --- bff/db/migration/000001_init_schema.up.sql | 4 - bff/db/mock/store.go | 58 +++ bff/db/query/document.sql | 6 +- bff/db/query/return.sql | 10 +- bff/db/query/returnsLog.sql | 19 +- bff/db/sqlc/document.sql.go | 10 + bff/db/sqlc/querier.go | 7 +- bff/db/sqlc/return.sql.go | 38 ++ bff/db/sqlc/returnsLog.sql.go | 29 +- bff/db/sqlc/tx_delete_person.go | 21 +- bff/doc/swagger/df.swagger.json | 96 ++++ bff/gapi/rpc_update_person.go | 109 +++++ bff/pb/rpc_update_account_privacy.pb.go | 57 ++- bff/pb/rpc_update_person.pb.go | 316 +++++++++++++ bff/pb/service_df.pb.go | 522 +++++++++++---------- bff/pb/service_df.pb.gw.go | 85 ++++ bff/pb/service_df_grpc.pb.go | 37 ++ bff/proto/rpc_update_account_privacy.proto | 2 +- bff/proto/rpc_update_person.proto | 45 ++ bff/proto/service_df.proto | 45 +- 20 files changed, 1197 insertions(+), 319 deletions(-) create mode 100644 bff/gapi/rpc_update_person.go create mode 100644 bff/pb/rpc_update_person.pb.go create mode 100644 bff/proto/rpc_update_person.proto diff --git a/bff/db/migration/000001_init_schema.up.sql b/bff/db/migration/000001_init_schema.up.sql index ef694b4..1186d43 100644 --- a/bff/db/migration/000001_init_schema.up.sql +++ b/bff/db/migration/000001_init_schema.up.sql @@ -136,10 +136,6 @@ ALTER TABLE "sessions" ADD FOREIGN KEY ("email") REFERENCES "accounts" ("email") ALTER TABLE "persons" ADD FOREIGN KEY ("account_id") REFERENCES "accounts" ("id"); -ALTER TABLE "documents" ADD FOREIGN KEY ("person_id") REFERENCES "persons" ("id"); - -ALTER TABLE "documents" ADD FOREIGN KEY ("mail_id") REFERENCES "mails" ("id"); - ALTER TABLE "payments" ADD FOREIGN KEY ("account_id") REFERENCES "accounts" ("id"); ALTER TABLE "returns" ADD FOREIGN KEY ("person_id") REFERENCES "persons" ("id"); diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index 6d7af15..6c91468 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -10,6 +10,7 @@ package mockdb import ( context "context" + sql "database/sql" reflect "reflect" uuid "github.com/google/uuid" @@ -276,6 +277,20 @@ func (mr *MockStoreMockRecorder) DeleteDocument(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDocument", reflect.TypeOf((*MockStore)(nil).DeleteDocument), arg0, arg1) } +// DeleteDocumentsByPersonID mocks base method. +func (m *MockStore) DeleteDocumentsByPersonID(arg0 context.Context, arg1 sql.NullInt64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteDocumentsByPersonID", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDocumentsByPersonID indicates an expected call of DeleteDocumentsByPersonID. +func (mr *MockStoreMockRecorder) DeleteDocumentsByPersonID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDocumentsByPersonID", reflect.TypeOf((*MockStore)(nil).DeleteDocumentsByPersonID), arg0, arg1) +} + // DeleteMail mocks base method. func (m *MockStore) DeleteMail(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() @@ -360,6 +375,20 @@ func (mr *MockStoreMockRecorder) DeleteReturn(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteReturn", reflect.TypeOf((*MockStore)(nil).DeleteReturn), arg0, arg1) } +// DeleteReturnsByPersonID mocks base method. +func (m *MockStore) DeleteReturnsByPersonID(arg0 context.Context, arg1 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteReturnsByPersonID", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteReturnsByPersonID indicates an expected call of DeleteReturnsByPersonID. +func (mr *MockStoreMockRecorder) DeleteReturnsByPersonID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteReturnsByPersonID", reflect.TypeOf((*MockStore)(nil).DeleteReturnsByPersonID), arg0, arg1) +} + // DeleteReturnsLog mocks base method. func (m *MockStore) DeleteReturnsLog(arg0 context.Context, arg1 uint64) error { m.ctrl.T.Helper() @@ -374,6 +403,20 @@ func (mr *MockStoreMockRecorder) DeleteReturnsLog(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteReturnsLog", reflect.TypeOf((*MockStore)(nil).DeleteReturnsLog), arg0, arg1) } +// DeleteReturnsLogsByPersonID mocks base method. +func (m *MockStore) DeleteReturnsLogsByPersonID(arg0 context.Context, arg1 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteReturnsLogsByPersonID", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteReturnsLogsByPersonID indicates an expected call of DeleteReturnsLogsByPersonID. +func (mr *MockStoreMockRecorder) DeleteReturnsLogsByPersonID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteReturnsLogsByPersonID", reflect.TypeOf((*MockStore)(nil).DeleteReturnsLogsByPersonID), arg0, arg1) +} + // GetAccount mocks base method. func (m *MockStore) GetAccount(arg0 context.Context, arg1 uint64) (db.Account, error) { m.ctrl.T.Helper() @@ -509,6 +552,21 @@ func (mr *MockStoreMockRecorder) GetReturn(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReturn", reflect.TypeOf((*MockStore)(nil).GetReturn), arg0, arg1) } +// GetReturnIDsByPersonID mocks base method. +func (m *MockStore) GetReturnIDsByPersonID(arg0 context.Context, arg1 uint64) ([]uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetReturnIDsByPersonID", arg0, arg1) + ret0, _ := ret[0].([]uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetReturnIDsByPersonID indicates an expected call of GetReturnIDsByPersonID. +func (mr *MockStoreMockRecorder) GetReturnIDsByPersonID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReturnIDsByPersonID", reflect.TypeOf((*MockStore)(nil).GetReturnIDsByPersonID), arg0, arg1) +} + // GetReturns mocks base method. func (m *MockStore) GetReturns(arg0 context.Context, arg1 uint64) ([]db.Return, error) { m.ctrl.T.Helper() diff --git a/bff/db/query/document.sql b/bff/db/query/document.sql index eadc243..7a0941d 100644 --- a/bff/db/query/document.sql +++ b/bff/db/query/document.sql @@ -72,4 +72,8 @@ RETURNING *; -- name: DeleteDocument :exec DELETE FROM documents -WHERE "id" = $1; \ No newline at end of file +WHERE "id" = $1; + +-- name: DeleteDocumentsByPersonID :exec +DELETE FROM "documents" +WHERE "person_id" = sqlc.arg(person_id); \ No newline at end of file diff --git a/bff/db/query/return.sql b/bff/db/query/return.sql index eb551cb..7722ee4 100644 --- a/bff/db/query/return.sql +++ b/bff/db/query/return.sql @@ -70,4 +70,12 @@ SELECT sqlc.arg(creator), sqlc.arg(creator), sqlc.arg(person_id) -FROM providers; \ No newline at end of file +FROM providers; + +-- name: GetReturnIDsByPersonID :many +SELECT "id" FROM "returns" +WHERE "person_id" = sqlc.arg(person_id); + +-- name: DeleteReturnsByPersonID :exec +DELETE FROM "returns" +WHERE "person_id" = sqlc.arg(person_id); \ No newline at end of file diff --git a/bff/db/query/returnsLog.sql b/bff/db/query/returnsLog.sql index ea259de..b1f1227 100644 --- a/bff/db/query/returnsLog.sql +++ b/bff/db/query/returnsLog.sql @@ -24,11 +24,20 @@ LIMIT $1 OFFSET $2; -- name: ListReturnsLogsByPersonID :many -SELECT rl.* -FROM "returns" AS r -INNER JOIN "returnsLog" AS rl - ON r.id = rl.return_id -WHERE r.person_id = sqlc.arg(id); +SELECT * FROM "returnsLog" +WHERE "return_id" IN ( + SELECT "id" + FROM "returns" + WHERE "person_id" = sqlc.arg(person_id) +); + +-- name: DeleteReturnsLogsByPersonID :exec +DELETE FROM "returnsLog" +WHERE "return_id" IN ( + SELECT "id" + FROM "returns" + WHERE "person_id" = sqlc.arg(person_id) +); -- name: UpdateReturnsLog :one UPDATE "returnsLog" diff --git a/bff/db/sqlc/document.sql.go b/bff/db/sqlc/document.sql.go index 7fbccaa..e28b5ef 100644 --- a/bff/db/sqlc/document.sql.go +++ b/bff/db/sqlc/document.sql.go @@ -130,6 +130,16 @@ func (q *Queries) DeleteDocument(ctx context.Context, id uint64) error { return err } +const deleteDocumentsByPersonID = `-- name: DeleteDocumentsByPersonID :exec +DELETE FROM "documents" +WHERE "person_id" = $1 +` + +func (q *Queries) DeleteDocumentsByPersonID(ctx context.Context, personID sql.NullInt64) error { + _, err := q.db.ExecContext(ctx, deleteDocumentsByPersonID, personID) + return err +} + const getDocument = `-- name: GetDocument :one SELECT id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed FROM documents WHERE "id" = $1 LIMIT 1 diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index ab09380..c48f10c 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -6,6 +6,7 @@ package db import ( "context" + "database/sql" "github.com/google/uuid" ) @@ -25,6 +26,7 @@ type Querier interface { CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) DeleteAccount(ctx context.Context, id uint64) error DeleteDocument(ctx context.Context, id uint64) error + DeleteDocumentsByPersonID(ctx context.Context, personID sql.NullInt64) error // -- name: UpdateMail :one // UPDATE mails // SET @@ -43,7 +45,9 @@ type Querier interface { DeletePerson(ctx context.Context, id uint64) error DeleteProvider(ctx context.Context, id uint64) error DeleteReturn(ctx context.Context, id uint64) error + DeleteReturnsByPersonID(ctx context.Context, personID uint64) error DeleteReturnsLog(ctx context.Context, id uint64) error + DeleteReturnsLogsByPersonID(ctx context.Context, personID uint64) error GetAccount(ctx context.Context, id uint64) (Account, error) GetAccountByEmail(ctx context.Context, email string) (Account, error) GetAccountForUpdate(ctx context.Context, id uint64) (Account, error) @@ -53,6 +57,7 @@ type Querier interface { GetPerson(ctx context.Context, id uint64) (Person, error) GetProvider(ctx context.Context, id uint64) (Provider, error) GetReturn(ctx context.Context, id uint64) (Return, error) + GetReturnIDsByPersonID(ctx context.Context, personID uint64) ([]uint64, error) GetReturns(ctx context.Context, id uint64) ([]Return, error) GetReturnsLog(ctx context.Context, id uint64) (ReturnsLog, error) GetSession(ctx context.Context, id uuid.UUID) (Session, error) @@ -65,7 +70,7 @@ type Querier interface { ListProviders(ctx context.Context, arg ListProvidersParams) ([]Provider, error) ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams) ([]ReturnsLog, error) - ListReturnsLogsByPersonID(ctx context.Context, id uint64) ([]ReturnsLog, error) + ListReturnsLogsByPersonID(ctx context.Context, personID uint64) ([]ReturnsLog, error) ListSessions(ctx context.Context, email string) ([]Session, error) UpdateAccount(ctx context.Context, arg UpdateAccountParams) (Account, error) UpdateAccountPrivacy(ctx context.Context, arg UpdateAccountPrivacyParams) (Account, error) diff --git a/bff/db/sqlc/return.sql.go b/bff/db/sqlc/return.sql.go index 4618e2e..a784141 100644 --- a/bff/db/sqlc/return.sql.go +++ b/bff/db/sqlc/return.sql.go @@ -121,6 +121,16 @@ func (q *Queries) DeleteReturn(ctx context.Context, id uint64) error { return err } +const deleteReturnsByPersonID = `-- name: DeleteReturnsByPersonID :exec +DELETE FROM "returns" +WHERE "person_id" = $1 +` + +func (q *Queries) DeleteReturnsByPersonID(ctx context.Context, personID uint64) error { + _, err := q.db.ExecContext(ctx, deleteReturnsByPersonID, personID) + return err +} + const getReturn = `-- name: GetReturn :one SELECT id, person_id, provider_id, name, description, category, email, status, creator, created, changer, changed FROM returns WHERE "id" = $1 LIMIT 1 @@ -146,6 +156,34 @@ func (q *Queries) GetReturn(ctx context.Context, id uint64) (Return, error) { return i, err } +const getReturnIDsByPersonID = `-- name: GetReturnIDsByPersonID :many +SELECT "id" FROM "returns" +WHERE "person_id" = $1 +` + +func (q *Queries) GetReturnIDsByPersonID(ctx context.Context, personID uint64) ([]uint64, error) { + rows, err := q.db.QueryContext(ctx, getReturnIDsByPersonID, personID) + if err != nil { + return nil, err + } + defer rows.Close() + items := []uint64{} + for rows.Next() { + var id uint64 + if err := rows.Scan(&id); err != nil { + return nil, err + } + items = append(items, id) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const listReturns = `-- name: ListReturns :many SELECT id, person_id, provider_id, name, description, category, email, status, creator, created, changer, changed FROM returns ORDER BY "name" diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index b235330..b7e31c9 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -64,6 +64,20 @@ func (q *Queries) DeleteReturnsLog(ctx context.Context, id uint64) error { return err } +const deleteReturnsLogsByPersonID = `-- name: DeleteReturnsLogsByPersonID :exec +DELETE FROM "returnsLog" +WHERE "return_id" IN ( + SELECT "id" + FROM "returns" + WHERE "person_id" = $1 +) +` + +func (q *Queries) DeleteReturnsLogsByPersonID(ctx context.Context, personID uint64) error { + _, err := q.db.ExecContext(ctx, deleteReturnsLogsByPersonID, personID) + return err +} + const getReturnsLog = `-- name: GetReturnsLog :one SELECT id, return_id, mail_id, status, creator, created, changer, changed FROM "returnsLog" WHERE "id" = $1 LIMIT 1 @@ -130,15 +144,16 @@ func (q *Queries) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams } const listReturnsLogsByPersonID = `-- name: ListReturnsLogsByPersonID :many -SELECT rl.id, rl.return_id, rl.mail_id, rl.status, rl.creator, rl.created, rl.changer, rl.changed -FROM "returns" AS r -INNER JOIN "returnsLog" AS rl - ON r.id = rl.return_id -WHERE r.person_id = $1 +SELECT id, return_id, mail_id, status, creator, created, changer, changed FROM "returnsLog" +WHERE "return_id" IN ( + SELECT "id" + FROM "returns" + WHERE "person_id" = $1 +) ` -func (q *Queries) ListReturnsLogsByPersonID(ctx context.Context, id uint64) ([]ReturnsLog, error) { - rows, err := q.db.QueryContext(ctx, listReturnsLogsByPersonID, id) +func (q *Queries) ListReturnsLogsByPersonID(ctx context.Context, personID uint64) ([]ReturnsLog, error) { + rows, err := q.db.QueryContext(ctx, listReturnsLogsByPersonID, personID) if err != nil { return nil, err } diff --git a/bff/db/sqlc/tx_delete_person.go b/bff/db/sqlc/tx_delete_person.go index 221e0be..317af22 100644 --- a/bff/db/sqlc/tx_delete_person.go +++ b/bff/db/sqlc/tx_delete_person.go @@ -2,14 +2,31 @@ package db import ( "context" + "database/sql" ) func (store *SQLStore) DeletePersonTx(ctx context.Context, id uint64) error { err := store.execTx(ctx, func(q *Queries) error { - // TODO: #82 Add removal of db.returnsLog entries. + err := q.DeleteDocumentsByPersonID(ctx, sql.NullInt64{ + Valid: true, + Int64: int64(id), + }) + if err != nil { + return err + } - err := q.DeletePerson(ctx, id) + err = q.DeleteReturnsLogsByPersonID(ctx, id) + if err != nil { + return err + } + + err = q.DeleteReturnsByPersonID(ctx, id) + if err != nil { + return err + } + + err = q.DeletePerson(ctx, id) if err != nil { return err } diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index 9bf2aa2..dbe99c7 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -577,6 +577,44 @@ ] } }, + "/v1/persons/update_person": { + "patch": { + "operationId": "df_UpdatePerson", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdatePersonResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Update an Person", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdatePersonRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/returns_log/list_returns_log/{personId}": { "get": { "operationId": "df_ListReturnsLog", @@ -1656,6 +1694,64 @@ "description": "Returns the updated Payment", "title": "Updated Payment" }, + "pbUpdatePersonRequest": { + "type": "object", + "example": { + "id": "1", + "firstname": "John", + "lastname": "Doe", + "phone": "", + "street": "Death Star 3", + "zip": "0816", + "city": "Montana", + "country": "Canada", + "birthday": "1992-10-05T00:00:00Z" + }, + "properties": { + "id": { + "type": "string", + "format": "uint64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "zip": { + "type": "string" + }, + "country": { + "type": "string" + }, + "birthday": { + "type": "string", + "format": "date-time", + "example": "1990-10-05T00:00:00Z" + } + }, + "description": "Update an Person", + "title": "Update Person", + "required": [ + "id" + ] + }, + "pbUpdatePersonResponse": { + "type": "object", + "properties": { + "person": { + "$ref": "#/definitions/pbPerson" + } + }, + "description": "Returns the updated Person", + "title": "Updated Person" + }, "protobufAny": { "type": "object", "properties": { diff --git a/bff/gapi/rpc_update_person.go b/bff/gapi/rpc_update_person.go new file mode 100644 index 0000000..2177add --- /dev/null +++ b/bff/gapi/rpc_update_person.go @@ -0,0 +1,109 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + "log/slog" + + db "github.com/itsscb/df/bff/db/sqlc" + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdatePerson(ctx context.Context, req *pb.UpdatePersonRequest) (*pb.UpdatePersonResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateUpdatePersonRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + slog.Error("update_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.Email != account.Email { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + dbPerson, err := server.store.GetPerson(ctx, req.GetId()) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "person not found") + } + slog.Error("update_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, "failed to get person") + } + + if dbPerson.AccountID != account.ID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "person not found") + } + } + + arg := db.UpdatePersonParams{ + ID: req.GetId(), + Firstname: sql.NullString{ + Valid: req.GetFirstname() != "", + String: req.GetFirstname(), + }, + Lastname: sql.NullString{ + Valid: req.GetLastname() != "", + String: req.GetLastname(), + }, + City: sql.NullString{ + Valid: req.GetCity() != "", + String: req.GetCity(), + }, + Zip: sql.NullString{ + Valid: req.GetZip() != "", + String: req.GetZip(), + }, + Street: sql.NullString{ + Valid: req.GetStreet() != "", + String: req.GetStreet(), + }, + Country: sql.NullString{ + Valid: req.GetCountry() != "", + String: req.GetCountry(), + }, + Birthday: sql.NullTime{ + Valid: req.GetBirthday().IsValid(), + Time: req.GetBirthday().AsTime(), + }, + Changer: authPayload.Email, + } + + person, err := server.store.UpdatePerson(ctx, arg) + if err != nil { + slog.Error("update_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, "failed to update person") + } + + rsp := &pb.UpdatePersonResponse{ + Person: convertPerson(person), + } + + return rsp, nil +} + +func validateUpdatePersonRequest(req *pb.UpdatePersonRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/pb/rpc_update_account_privacy.pb.go b/bff/pb/rpc_update_account_privacy.pb.go index 7383e11..c730c57 100644 --- a/bff/pb/rpc_update_account_privacy.pb.go +++ b/bff/pb/rpc_update_account_privacy.pb.go @@ -27,7 +27,7 @@ type UpdateAccountPrivacyRequest struct { unknownFields protoimpl.UnknownFields Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PrivacyAccepted *bool `protobuf:"varint,2,opt,name=privacy_accepted,json=privacyAccepted,proto3,oneof" json:"privacy_accepted,omitempty"` + PrivacyAccepted bool `protobuf:"varint,2,opt,name=privacy_accepted,json=privacyAccepted,proto3" json:"privacy_accepted,omitempty"` } func (x *UpdateAccountPrivacyRequest) Reset() { @@ -70,8 +70,8 @@ func (x *UpdateAccountPrivacyRequest) GetId() uint64 { } func (x *UpdateAccountPrivacyRequest) GetPrivacyAccepted() bool { - if x != nil && x.PrivacyAccepted != nil { - return *x.PrivacyAccepted + if x != nil { + return x.PrivacyAccepted } return false } @@ -132,36 +132,34 @@ var file_rpc_update_account_privacy_proto_rawDesc = []byte{ 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x02, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x02, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0x92, 0x41, 0x0b, 0x4a, 0x01, 0x31, 0xa2, 0x02, 0x05, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, + 0x34, 0x52, 0x02, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x0a, 0x92, 0x41, 0x07, 0x4a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x88, 0x01, - 0x01, 0x3a, 0x90, 0x01, 0x92, 0x41, 0x8c, 0x01, 0x0a, 0x62, 0x2a, 0x1e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, - 0x63, 0x79, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x32, 0x28, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0xd2, 0x01, 0x10, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x63, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x32, 0x26, 0x7b, 0x22, - 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x72, 0x69, 0x76, 0x61, - 0x63, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, - 0x75, 0x65, 0x20, 0x7d, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, - 0x5f, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x1c, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, - 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x14, 0x92, 0x41, 0x11, 0x2a, 0x0f, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x26, 0x92, 0x41, 0x23, 0x0a, 0x21, 0x2a, 0x1f, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, - 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, - 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x0a, 0x92, 0x41, 0x07, 0x4a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x70, 0x72, 0x69, + 0x76, 0x61, 0x63, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x3a, 0x90, 0x01, 0x92, + 0x41, 0x8c, 0x01, 0x0a, 0x62, 0x2a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x32, 0x28, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xd2, + 0x01, 0x02, 0x69, 0x64, 0xd2, 0x01, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x61, + 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x32, 0x26, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, + 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x7d, 0x22, + 0x83, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x14, + 0x92, 0x41, 0x11, 0x2a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x26, 0x92, + 0x41, 0x23, 0x0a, 0x21, 0x2a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -223,7 +221,6 @@ func file_rpc_update_account_privacy_proto_init() { } } } - file_rpc_update_account_privacy_proto_msgTypes[0].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/bff/pb/rpc_update_person.pb.go b/bff/pb/rpc_update_person.pb.go new file mode 100644 index 0000000..c28d02a --- /dev/null +++ b/bff/pb/rpc_update_person.pb.go @@ -0,0 +1,316 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_update_person.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UpdatePersonRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Firstname *string `protobuf:"bytes,2,opt,name=firstname,proto3,oneof" json:"firstname,omitempty"` + Lastname *string `protobuf:"bytes,3,opt,name=lastname,proto3,oneof" json:"lastname,omitempty"` + Street *string `protobuf:"bytes,4,opt,name=street,proto3,oneof" json:"street,omitempty"` + City *string `protobuf:"bytes,5,opt,name=city,proto3,oneof" json:"city,omitempty"` + Zip *string `protobuf:"bytes,6,opt,name=zip,proto3,oneof" json:"zip,omitempty"` + Country *string `protobuf:"bytes,7,opt,name=country,proto3,oneof" json:"country,omitempty"` + Birthday *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=birthday,proto3,oneof" json:"birthday,omitempty"` +} + +func (x *UpdatePersonRequest) Reset() { + *x = UpdatePersonRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_update_person_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePersonRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePersonRequest) ProtoMessage() {} + +func (x *UpdatePersonRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_update_person_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePersonRequest.ProtoReflect.Descriptor instead. +func (*UpdatePersonRequest) Descriptor() ([]byte, []int) { + return file_rpc_update_person_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdatePersonRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdatePersonRequest) GetFirstname() string { + if x != nil && x.Firstname != nil { + return *x.Firstname + } + return "" +} + +func (x *UpdatePersonRequest) GetLastname() string { + if x != nil && x.Lastname != nil { + return *x.Lastname + } + return "" +} + +func (x *UpdatePersonRequest) GetStreet() string { + if x != nil && x.Street != nil { + return *x.Street + } + return "" +} + +func (x *UpdatePersonRequest) GetCity() string { + if x != nil && x.City != nil { + return *x.City + } + return "" +} + +func (x *UpdatePersonRequest) GetZip() string { + if x != nil && x.Zip != nil { + return *x.Zip + } + return "" +} + +func (x *UpdatePersonRequest) GetCountry() string { + if x != nil && x.Country != nil { + return *x.Country + } + return "" +} + +func (x *UpdatePersonRequest) GetBirthday() *timestamppb.Timestamp { + if x != nil { + return x.Birthday + } + return nil +} + +type UpdatePersonResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Person *Person `protobuf:"bytes,1,opt,name=person,proto3" json:"person,omitempty"` +} + +func (x *UpdatePersonResponse) Reset() { + *x = UpdatePersonResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_update_person_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePersonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePersonResponse) ProtoMessage() {} + +func (x *UpdatePersonResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_update_person_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePersonResponse.ProtoReflect.Descriptor instead. +func (*UpdatePersonResponse) Descriptor() ([]byte, []int) { + return file_rpc_update_person_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdatePersonResponse) GetPerson() *Person { + if x != nil { + return x.Person + } + return nil +} + +var File_rpc_update_person_proto protoreflect.FileDescriptor + +var file_rpc_update_person_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x04, 0x0a, + 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x73, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, + 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, + 0x65, 0x74, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x15, + 0x0a, 0x03, 0x7a, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x03, 0x7a, + 0x69, 0x70, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x88, 0x01, 0x01, 0x12, 0x58, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, + 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x48, + 0x06, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x88, 0x01, 0x01, 0x3a, 0xe5, + 0x01, 0x92, 0x41, 0xe1, 0x01, 0x0a, 0x26, 0x2a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, + 0x6e, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0xb6, 0x01, + 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x4a, 0x6f, 0x68, 0x6e, 0x22, 0x2c, + 0x20, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x6f, + 0x65, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, + 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x65, 0x61, 0x74, + 0x68, 0x20, 0x53, 0x74, 0x61, 0x72, 0x20, 0x33, 0x22, 0x2c, 0x20, 0x22, 0x7a, 0x69, 0x70, 0x22, + 0x3a, 0x20, 0x22, 0x30, 0x38, 0x31, 0x36, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x69, 0x74, 0x79, 0x22, + 0x3a, 0x20, 0x22, 0x4d, 0x6f, 0x6e, 0x74, 0x61, 0x6e, 0x61, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x22, + 0x2c, 0x20, 0x22, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x31, + 0x39, 0x39, 0x32, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, + 0x30, 0x30, 0x5a, 0x22, 0x20, 0x7d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x6e, 0x61, 0x6d, + 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x63, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x7a, 0x69, 0x70, 0x42, 0x0a, 0x0a, + 0x08, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x62, 0x69, + 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x72, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, + 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0x92, 0x41, 0x00, 0x52, + 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, 0x2c, 0x2a, 0x0e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x32, 0x1a, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, + 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_update_person_proto_rawDescOnce sync.Once + file_rpc_update_person_proto_rawDescData = file_rpc_update_person_proto_rawDesc +) + +func file_rpc_update_person_proto_rawDescGZIP() []byte { + file_rpc_update_person_proto_rawDescOnce.Do(func() { + file_rpc_update_person_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_update_person_proto_rawDescData) + }) + return file_rpc_update_person_proto_rawDescData +} + +var file_rpc_update_person_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_update_person_proto_goTypes = []interface{}{ + (*UpdatePersonRequest)(nil), // 0: pb.UpdatePersonRequest + (*UpdatePersonResponse)(nil), // 1: pb.UpdatePersonResponse + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*Person)(nil), // 3: pb.Person +} +var file_rpc_update_person_proto_depIdxs = []int32{ + 2, // 0: pb.UpdatePersonRequest.birthday:type_name -> google.protobuf.Timestamp + 3, // 1: pb.UpdatePersonResponse.person:type_name -> pb.Person + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_rpc_update_person_proto_init() } +func file_rpc_update_person_proto_init() { + if File_rpc_update_person_proto != nil { + return + } + file_person_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_update_person_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePersonRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_update_person_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePersonResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_rpc_update_person_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_update_person_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_update_person_proto_goTypes, + DependencyIndexes: file_rpc_update_person_proto_depIdxs, + MessageInfos: file_rpc_update_person_proto_msgTypes, + }.Build() + File_rpc_update_person_proto = out.File + file_rpc_update_person_proto_rawDesc = nil + file_rpc_update_person_proto_goTypes = nil + file_rpc_update_person_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index d949e3a..ea1e889 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -31,199 +31,208 @@ var file_service_df_proto_rawDesc = []byte{ 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, - 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, - 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, + 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, + 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x72, 0x70, 0x63, + 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x16, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, + 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, - 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x14, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x70, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, - 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, - 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x72, 0x70, 0x63, 0x5f, - 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, - 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe9, 0x12, - 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, - 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, - 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x20, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x0f, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, + 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x72, + 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, + 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe7, 0x13, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, + 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, - 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, - 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, + 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, - 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, - 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, - 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, - 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, - 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, - 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, - 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, - 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, - 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, - 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, - 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, - 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, - 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, - 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, - 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, - 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x92, 0x01, 0x0a, 0x0e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, + 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x7c, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, + 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x32, 0x19, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, + 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, + 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, + 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, - 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, - 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, - 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, - 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, - 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, - 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, - 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, - 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, - 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, + 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x92, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x92, 0x41, + 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x7b, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, + 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, + 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, + 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, + 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, + 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -237,34 +246,36 @@ var file_service_df_proto_goTypes = []interface{}{ (*UpdateAccountRequest)(nil), // 7: pb.UpdateAccountRequest (*UpdateAccountPrivacyRequest)(nil), // 8: pb.UpdateAccountPrivacyRequest (*CreatePersonRequest)(nil), // 9: pb.CreatePersonRequest - (*GetPersonRequest)(nil), // 10: pb.GetPersonRequest - (*DeletePersonRequest)(nil), // 11: pb.DeletePersonRequest - (*ListPersonsRequest)(nil), // 12: pb.ListPersonsRequest - (*CreatePaymentRequest)(nil), // 13: pb.CreatePaymentRequest - (*GetPaymentRequest)(nil), // 14: pb.GetPaymentRequest - (*DeletePaymentRequest)(nil), // 15: pb.DeletePaymentRequest - (*ListPaymentsRequest)(nil), // 16: pb.ListPaymentsRequest - (*UpdatePaymentRequest)(nil), // 17: pb.UpdatePaymentRequest - (*ListReturnsLogRequest)(nil), // 18: pb.ListReturnsLogRequest - (*LoginResponse)(nil), // 19: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 20: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 21: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 22: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 23: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 24: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 25: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 26: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 27: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 28: pb.CreatePersonResponse - (*GetPersonResponse)(nil), // 29: pb.GetPersonResponse - (*DeletePersonResponse)(nil), // 30: pb.DeletePersonResponse - (*ListPersonsResponse)(nil), // 31: pb.ListPersonsResponse - (*CreatePaymentResponse)(nil), // 32: pb.CreatePaymentResponse - (*GetPaymentResponse)(nil), // 33: pb.GetPaymentResponse - (*DeletePaymentResponse)(nil), // 34: pb.DeletePaymentResponse - (*ListPaymentsResponse)(nil), // 35: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 36: pb.UpdatePaymentResponse - (*ListReturnsLogResponse)(nil), // 37: pb.ListReturnsLogResponse + (*UpdatePersonRequest)(nil), // 10: pb.UpdatePersonRequest + (*GetPersonRequest)(nil), // 11: pb.GetPersonRequest + (*DeletePersonRequest)(nil), // 12: pb.DeletePersonRequest + (*ListPersonsRequest)(nil), // 13: pb.ListPersonsRequest + (*CreatePaymentRequest)(nil), // 14: pb.CreatePaymentRequest + (*GetPaymentRequest)(nil), // 15: pb.GetPaymentRequest + (*DeletePaymentRequest)(nil), // 16: pb.DeletePaymentRequest + (*ListPaymentsRequest)(nil), // 17: pb.ListPaymentsRequest + (*UpdatePaymentRequest)(nil), // 18: pb.UpdatePaymentRequest + (*ListReturnsLogRequest)(nil), // 19: pb.ListReturnsLogRequest + (*LoginResponse)(nil), // 20: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 21: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 22: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 23: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 24: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 25: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 26: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 27: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 28: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 29: pb.CreatePersonResponse + (*UpdatePersonResponse)(nil), // 30: pb.UpdatePersonResponse + (*GetPersonResponse)(nil), // 31: pb.GetPersonResponse + (*DeletePersonResponse)(nil), // 32: pb.DeletePersonResponse + (*ListPersonsResponse)(nil), // 33: pb.ListPersonsResponse + (*CreatePaymentResponse)(nil), // 34: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 35: pb.GetPaymentResponse + (*DeletePaymentResponse)(nil), // 36: pb.DeletePaymentResponse + (*ListPaymentsResponse)(nil), // 37: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 38: pb.UpdatePaymentResponse + (*ListReturnsLogResponse)(nil), // 39: pb.ListReturnsLogResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -277,36 +288,38 @@ var file_service_df_proto_depIdxs = []int32{ 7, // 7: pb.df.UpdateAccount:input_type -> pb.UpdateAccountRequest 8, // 8: pb.df.UpdateAccountPrivacy:input_type -> pb.UpdateAccountPrivacyRequest 9, // 9: pb.df.CreatePerson:input_type -> pb.CreatePersonRequest - 10, // 10: pb.df.GetPerson:input_type -> pb.GetPersonRequest - 11, // 11: pb.df.DeletePerson:input_type -> pb.DeletePersonRequest - 12, // 12: pb.df.ListPersons:input_type -> pb.ListPersonsRequest - 13, // 13: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest - 14, // 14: pb.df.GetPayment:input_type -> pb.GetPaymentRequest - 15, // 15: pb.df.DeletePayment:input_type -> pb.DeletePaymentRequest - 16, // 16: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest - 17, // 17: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest - 18, // 18: pb.df.ListReturnsLog:input_type -> pb.ListReturnsLogRequest - 19, // 19: pb.df.Login:output_type -> pb.LoginResponse - 20, // 20: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 21, // 21: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 22, // 22: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 23, // 23: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 24, // 24: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 25, // 25: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 26, // 26: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 27, // 27: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 28, // 28: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 29, // 29: pb.df.GetPerson:output_type -> pb.GetPersonResponse - 30, // 30: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse - 31, // 31: pb.df.ListPersons:output_type -> pb.ListPersonsResponse - 32, // 32: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 33, // 33: pb.df.GetPayment:output_type -> pb.GetPaymentResponse - 34, // 34: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse - 35, // 35: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 36, // 36: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 37, // 37: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse - 19, // [19:38] is the sub-list for method output_type - 0, // [0:19] is the sub-list for method input_type + 10, // 10: pb.df.UpdatePerson:input_type -> pb.UpdatePersonRequest + 11, // 11: pb.df.GetPerson:input_type -> pb.GetPersonRequest + 12, // 12: pb.df.DeletePerson:input_type -> pb.DeletePersonRequest + 13, // 13: pb.df.ListPersons:input_type -> pb.ListPersonsRequest + 14, // 14: pb.df.CreatePayment:input_type -> pb.CreatePaymentRequest + 15, // 15: pb.df.GetPayment:input_type -> pb.GetPaymentRequest + 16, // 16: pb.df.DeletePayment:input_type -> pb.DeletePaymentRequest + 17, // 17: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest + 18, // 18: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest + 19, // 19: pb.df.ListReturnsLog:input_type -> pb.ListReturnsLogRequest + 20, // 20: pb.df.Login:output_type -> pb.LoginResponse + 21, // 21: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 22, // 22: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 23, // 23: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 24, // 24: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 25, // 25: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 26, // 26: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 27, // 27: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 28, // 28: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 29, // 29: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 30, // 30: pb.df.UpdatePerson:output_type -> pb.UpdatePersonResponse + 31, // 31: pb.df.GetPerson:output_type -> pb.GetPersonResponse + 32, // 32: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse + 33, // 33: pb.df.ListPersons:output_type -> pb.ListPersonsResponse + 34, // 34: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 35, // 35: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 36, // 36: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse + 37, // 37: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 38, // 38: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 39, // 39: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse + 20, // [20:40] is the sub-list for method output_type + 0, // [0:20] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -317,25 +330,26 @@ func file_service_df_proto_init() { if File_service_df_proto != nil { return } - file_rpc_create_account_proto_init() - file_rpc_create_person_proto_init() file_rpc_create_payment_proto_init() - file_rpc_update_account_proto_init() - file_rpc_update_payment_proto_init() - file_rpc_get_account_proto_init() - file_rpc_delete_person_proto_init() - file_rpc_delete_payment_proto_init() - file_rpc_get_person_proto_init() file_rpc_get_payment_proto_init() - file_rpc_list_accounts_proto_init() - file_rpc_list_persons_proto_init() file_rpc_list_payments_proto_init() - file_rpc_list_sessions_proto_init() - file_rpc_block_session_proto_init() + file_rpc_update_payment_proto_init() + file_rpc_delete_payment_proto_init() + file_rpc_create_person_proto_init() + file_rpc_get_person_proto_init() + file_rpc_list_persons_proto_init() + file_rpc_update_person_proto_init() + file_rpc_delete_person_proto_init() + file_rpc_create_account_proto_init() + file_rpc_get_account_proto_init() + file_rpc_list_accounts_proto_init() + file_rpc_update_account_proto_init() file_rpc_update_account_privacy_proto_init() - file_rpc_list_returns_log_by_person_id_proto_init() file_rpc_login_proto_init() + file_rpc_list_sessions_proto_init() file_rpc_refresh_token_proto_init() + file_rpc_block_session_proto_init() + file_rpc_list_returns_log_by_person_id_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 71dddfc..c2cfd30 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -409,6 +409,40 @@ func local_request_Df_CreatePerson_0(ctx context.Context, marshaler runtime.Mars } +func request_Df_UpdatePerson_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePersonRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdatePerson(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_UpdatePerson_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdatePersonRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdatePerson(ctx, &protoReq) + return msg, metadata, err + +} + func request_Df_GetPerson_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetPersonRequest var metadata runtime.ServerMetadata @@ -1097,6 +1131,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("PATCH", pattern_Df_UpdatePerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UpdatePerson", runtime.WithHTTPPathPattern("/v1/persons/update_person")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_UpdatePerson_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UpdatePerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_GetPerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1583,6 +1642,28 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("PATCH", pattern_Df_UpdatePerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UpdatePerson", runtime.WithHTTPPathPattern("/v1/persons/update_person")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_UpdatePerson_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UpdatePerson_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Df_GetPerson_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1805,6 +1886,8 @@ var ( pattern_Df_CreatePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "persons", "create_person"}, "")) + pattern_Df_UpdatePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "persons", "update_person"}, "")) + pattern_Df_GetPerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "persons", "get_person", "id"}, "")) pattern_Df_DeletePerson_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "persons", "delete_person", "id"}, "")) @@ -1845,6 +1928,8 @@ var ( forward_Df_CreatePerson_0 = runtime.ForwardResponseMessage + forward_Df_UpdatePerson_0 = runtime.ForwardResponseMessage + forward_Df_GetPerson_0 = runtime.ForwardResponseMessage forward_Df_DeletePerson_0 = runtime.ForwardResponseMessage diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index fecdd23..f2d6c62 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -29,6 +29,7 @@ const ( Df_UpdateAccount_FullMethodName = "/pb.df/UpdateAccount" Df_UpdateAccountPrivacy_FullMethodName = "/pb.df/UpdateAccountPrivacy" Df_CreatePerson_FullMethodName = "/pb.df/CreatePerson" + Df_UpdatePerson_FullMethodName = "/pb.df/UpdatePerson" Df_GetPerson_FullMethodName = "/pb.df/GetPerson" Df_DeletePerson_FullMethodName = "/pb.df/DeletePerson" Df_ListPersons_FullMethodName = "/pb.df/ListPersons" @@ -54,6 +55,7 @@ type DfClient interface { UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*UpdateAccountResponse, error) UpdateAccountPrivacy(ctx context.Context, in *UpdateAccountPrivacyRequest, opts ...grpc.CallOption) (*UpdateAccountPrivacyResponse, error) CreatePerson(ctx context.Context, in *CreatePersonRequest, opts ...grpc.CallOption) (*CreatePersonResponse, error) + UpdatePerson(ctx context.Context, in *UpdatePersonRequest, opts ...grpc.CallOption) (*UpdatePersonResponse, error) GetPerson(ctx context.Context, in *GetPersonRequest, opts ...grpc.CallOption) (*GetPersonResponse, error) DeletePerson(ctx context.Context, in *DeletePersonRequest, opts ...grpc.CallOption) (*DeletePersonResponse, error) ListPersons(ctx context.Context, in *ListPersonsRequest, opts ...grpc.CallOption) (*ListPersonsResponse, error) @@ -163,6 +165,15 @@ func (c *dfClient) CreatePerson(ctx context.Context, in *CreatePersonRequest, op return out, nil } +func (c *dfClient) UpdatePerson(ctx context.Context, in *UpdatePersonRequest, opts ...grpc.CallOption) (*UpdatePersonResponse, error) { + out := new(UpdatePersonResponse) + err := c.cc.Invoke(ctx, Df_UpdatePerson_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfClient) GetPerson(ctx context.Context, in *GetPersonRequest, opts ...grpc.CallOption) (*GetPersonResponse, error) { out := new(GetPersonResponse) err := c.cc.Invoke(ctx, Df_GetPerson_FullMethodName, in, out, opts...) @@ -258,6 +269,7 @@ type DfServer interface { UpdateAccount(context.Context, *UpdateAccountRequest) (*UpdateAccountResponse, error) UpdateAccountPrivacy(context.Context, *UpdateAccountPrivacyRequest) (*UpdateAccountPrivacyResponse, error) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) + UpdatePerson(context.Context, *UpdatePersonRequest) (*UpdatePersonResponse, error) GetPerson(context.Context, *GetPersonRequest) (*GetPersonResponse, error) DeletePerson(context.Context, *DeletePersonRequest) (*DeletePersonResponse, error) ListPersons(context.Context, *ListPersonsRequest) (*ListPersonsResponse, error) @@ -304,6 +316,9 @@ func (UnimplementedDfServer) UpdateAccountPrivacy(context.Context, *UpdateAccoun func (UnimplementedDfServer) CreatePerson(context.Context, *CreatePersonRequest) (*CreatePersonResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePerson not implemented") } +func (UnimplementedDfServer) UpdatePerson(context.Context, *UpdatePersonRequest) (*UpdatePersonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePerson not implemented") +} func (UnimplementedDfServer) GetPerson(context.Context, *GetPersonRequest) (*GetPersonResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPerson not implemented") } @@ -524,6 +539,24 @@ func _Df_CreatePerson_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Df_UpdatePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePersonRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).UpdatePerson(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_UpdatePerson_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).UpdatePerson(ctx, req.(*UpdatePersonRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Df_GetPerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetPersonRequest) if err := dec(in); err != nil { @@ -733,6 +766,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePerson", Handler: _Df_CreatePerson_Handler, }, + { + MethodName: "UpdatePerson", + Handler: _Df_UpdatePerson_Handler, + }, { MethodName: "GetPerson", Handler: _Df_GetPerson_Handler, diff --git a/bff/proto/rpc_update_account_privacy.proto b/bff/proto/rpc_update_account_privacy.proto index 01f67f8..b920059 100644 --- a/bff/proto/rpc_update_account_privacy.proto +++ b/bff/proto/rpc_update_account_privacy.proto @@ -24,7 +24,7 @@ message UpdateAccountPrivacyRequest { example: "1", format: "int64" }]; - optional bool privacy_accepted = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + bool privacy_accepted = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "false" }]; } diff --git a/bff/proto/rpc_update_person.proto b/bff/proto/rpc_update_person.proto new file mode 100644 index 0000000..f6fdabe --- /dev/null +++ b/bff/proto/rpc_update_person.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + + +import "person.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message UpdatePersonRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Update Person"; + description: "Update an Person"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"phone\": \"\", \"street\": \"Death Star 3\", \"zip\": \"0816\", \"city\": \"Montana\", \"country\": \"Canada\", \"birthday\": \"1992-10-05T00:00:00Z\" }"; + }; + uint64 id = 1; + optional string firstname = 2; + optional string lastname = 3; + optional string street = 4; + optional string city = 5; + optional string zip = 6; + optional string country = 7; + optional google.protobuf.Timestamp birthday = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"1990-10-05T00:00:00Z\"" + }]; +} + +message UpdatePersonResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Updated Person"; + description: "Returns the updated Person"; + }; + }; + Person person = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + }]; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index c532125..6269472 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -5,25 +5,30 @@ package pb; import "google/api/annotations.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; -import "rpc_create_account.proto"; -import "rpc_create_person.proto"; import "rpc_create_payment.proto"; -import "rpc_update_account.proto"; -import "rpc_update_payment.proto"; -import "rpc_get_account.proto"; -import "rpc_delete_person.proto"; -import "rpc_delete_payment.proto"; -import "rpc_get_person.proto"; import "rpc_get_payment.proto"; -import "rpc_list_accounts.proto"; -import "rpc_list_persons.proto"; import "rpc_list_payments.proto"; -import "rpc_list_sessions.proto"; -import "rpc_block_session.proto"; +import "rpc_update_payment.proto"; +import "rpc_delete_payment.proto"; + +import "rpc_create_person.proto"; +import "rpc_get_person.proto"; +import "rpc_list_persons.proto"; +import "rpc_update_person.proto"; +import "rpc_delete_person.proto"; + +import "rpc_create_account.proto"; +import "rpc_get_account.proto"; +import "rpc_list_accounts.proto"; +import "rpc_update_account.proto"; import "rpc_update_account_privacy.proto"; -import "rpc_list_returns_log_by_person_id.proto"; + import "rpc_login.proto"; +import "rpc_list_sessions.proto"; import "rpc_refresh_token.proto"; +import "rpc_block_session.proto"; + +import "rpc_list_returns_log_by_person_id.proto"; option go_package = "github.com/itsscb/df/pb"; @@ -173,6 +178,20 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc UpdatePerson (UpdatePersonRequest) returns (UpdatePersonResponse) { + option (google.api.http) = { + patch: "/v1/persons/update_person" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; rpc GetPerson (GetPersonRequest) returns (GetPersonResponse) { option (google.api.http) = { get: "/v1/persons/get_person/{id}" From d7b4f66e382cd6d62daec0c3c96e03fbf23fe003 Mon Sep 17 00:00:00 2001 From: itsscb Date: Wed, 11 Oct 2023 03:28:30 +0200 Subject: [PATCH 11/15] ft/adds document upload adds http.endpoint replaces net/http with gin as gateway moves gateway server into separate package --- bff/doc/swagger/df.swagger.json | 150 +++++++++ bff/gw/document.go | 57 ++++ bff/gw/server.go | 47 +++ bff/main.go | 20 +- bff/pb/document.pb.go | 292 ++++++++++++++++++ bff/pb/rpc_upload_document.pb.go | 249 +++++++++++++++ bff/pb/service_df.pb.go | 456 ++++++++++++++++------------ bff/pb/service_df.pb.gw.go | 85 ++++++ bff/pb/service_df_grpc.pb.go | 37 +++ bff/proto/document.proto | 36 +++ bff/proto/rpc_upload_document.proto | 34 +++ bff/proto/service_df.proto | 40 ++- 12 files changed, 1293 insertions(+), 210 deletions(-) create mode 100644 bff/gw/document.go create mode 100644 bff/gw/server.go create mode 100644 bff/pb/document.pb.go create mode 100644 bff/pb/rpc_upload_document.pb.go create mode 100644 bff/proto/document.proto create mode 100644 bff/proto/rpc_upload_document.proto diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index dbe99c7..29f762d 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -26,8 +26,49 @@ "application/json" ], "paths": { + "/documents/upload": { + "post": { + "summary": "Upload Document [only HTTP]", + "description": "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" \"http://{serverURI}/documents/upload\"```", + "operationId": "df_UploadDocument", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUploadDocumentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Upload a Document [only HTTP]", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUploadDocumentRequest" + } + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/accounts/create_account": { "post": { + "summary": "Create Account", "operationId": "df_CreateAccount", "responses": { "200": { @@ -61,6 +102,7 @@ }, "/v1/accounts/get_account/{id}": { "get": { + "summary": "Get Account by account_id", "operationId": "df_GetAccount", "responses": { "200": { @@ -97,6 +139,7 @@ }, "/v1/accounts/list_accounts": { "get": { + "summary": "List Accounts [admin only]", "operationId": "df_ListAccounts", "responses": { "200": { @@ -140,6 +183,7 @@ }, "/v1/accounts/update_account": { "patch": { + "summary": "Update Account", "operationId": "df_UpdateAccount", "responses": { "200": { @@ -178,6 +222,7 @@ }, "/v1/accounts/update_account_privacy": { "patch": { + "summary": "Update Account Privacy Settings", "operationId": "df_UpdateAccountPrivacy", "responses": { "200": { @@ -249,6 +294,7 @@ }, "/v1/payments/create_payment": { "post": { + "summary": "Create Payment", "operationId": "df_CreatePayment", "responses": { "200": { @@ -287,6 +333,7 @@ }, "/v1/payments/delete_payment/{id}": { "delete": { + "summary": "Delete Payment by ID", "operationId": "df_DeletePayment", "responses": { "200": { @@ -323,6 +370,7 @@ }, "/v1/payments/get_payment/{id}": { "get": { + "summary": "Get Payment by ID", "operationId": "df_GetPayment", "responses": { "200": { @@ -359,6 +407,7 @@ }, "/v1/payments/list_payments/{accountId}": { "get": { + "summary": "List Payments by account_id", "operationId": "df_ListPayments", "responses": { "200": { @@ -395,6 +444,7 @@ }, "/v1/payments/update_payment": { "patch": { + "summary": "Update Payment", "operationId": "df_UpdatePayment", "responses": { "200": { @@ -433,6 +483,7 @@ }, "/v1/persons/create_person": { "post": { + "summary": "Create Person", "operationId": "df_CreatePerson", "responses": { "200": { @@ -471,6 +522,7 @@ }, "/v1/persons/delete_person/{id}": { "delete": { + "summary": "Delete Person by ID", "operationId": "df_DeletePerson", "responses": { "200": { @@ -507,6 +559,7 @@ }, "/v1/persons/get_person/{id}": { "get": { + "summary": "Get Person by ID", "operationId": "df_GetPerson", "responses": { "200": { @@ -543,6 +596,7 @@ }, "/v1/persons/list_persons/{accountId}": { "get": { + "summary": "List Persons by account_id", "operationId": "df_ListPersons", "responses": { "200": { @@ -579,6 +633,7 @@ }, "/v1/persons/update_person": { "patch": { + "summary": "Update Person", "operationId": "df_UpdatePerson", "responses": { "200": { @@ -617,6 +672,7 @@ }, "/v1/returns_log/list_returns_log/{personId}": { "get": { + "summary": "List ReturnsLog by person_id", "operationId": "df_ListReturnsLog", "responses": { "200": { @@ -653,6 +709,7 @@ }, "/v1/sessions/block_session": { "patch": { + "summary": "Block Session by ID", "operationId": "df_BlockSession", "responses": { "200": { @@ -691,6 +748,7 @@ }, "/v1/sessions/list_sessions/{accountId}": { "get": { + "summary": "List Sessions by account_id", "operationId": "df_ListSessions", "responses": { "200": { @@ -1114,6 +1172,63 @@ }, "title": "Delete Person Response" }, + "pbDocument": { + "type": "object", + "properties": { + "personId": { + "type": "string", + "format": "uint64" + }, + "mailId": { + "type": "string", + "format": "uint64" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "path": { + "type": "string" + }, + "url": { + "type": "string" + }, + "valid": { + "type": "boolean" + }, + "validatedBy": { + "type": "string" + }, + "validDate": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + }, + "creator": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + }, + "changer": { + "type": "string" + }, + "changed": { + "type": "string", + "format": "date-time", + "example": "2023-10-05T00:00:00Z" + }, + "id": { + "type": "string", + "format": "uint64" + } + }, + "title": "Document" + }, "pbGetAccountResponse": { "type": "object", "properties": { @@ -1752,6 +1867,41 @@ "description": "Returns the updated Person", "title": "Updated Person" }, + "pbUploadDocumentRequest": { + "type": "object", + "example": { + "file": "10101010101010010100101010010101", + "person_id": "1" + }, + "properties": { + "file": { + "type": "string", + "format": "byte" + }, + "personId": { + "type": "string", + "format": "uint64" + }, + "mailId": { + "type": "string", + "format": "uint64" + } + }, + "description": "Upload a Document [only HTTP]", + "title": "UploadDocument [only HTTP]", + "required": [ + "file" + ] + }, + "pbUploadDocumentResponse": { + "type": "object", + "properties": { + "document": { + "$ref": "#/definitions/pbDocument" + } + }, + "title": "UploadDocument Response" + }, "protobufAny": { "type": "object", "properties": { diff --git a/bff/gw/document.go b/bff/gw/document.go new file mode 100644 index 0000000..ef04f7b --- /dev/null +++ b/bff/gw/document.go @@ -0,0 +1,57 @@ +package gw + +import ( + "errors" + "fmt" + "net/http" + "os" + "path/filepath" + "strings" + + "github.com/gin-gonic/gin" +) + +func (server *Server) UploadDocument(ctx *gin.Context) { + authHeader := ctx.GetHeader("authorization") + + authFields := strings.Fields(authHeader) + + if len(authFields) != 2 { + ctx.JSON(http.StatusUnauthorized, errorResponse(errors.New("invalid or missing authorization header"))) + return + } + + token := authFields[1] + + authPayload, err := server.tokenMaker.VerifyToken(token) + if err != nil { + ctx.JSON(http.StatusUnauthorized, errorResponse(errors.New("invalid authorization header"))) + return + } + + account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + if err != nil { + ctx.JSON(http.StatusNotFound, errorResponse(errors.New("account not found"))) + return + } + + file, err := ctx.FormFile("file") + if err != nil { + ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not parse file"))) + return + } + + p := filepath.Join("./files", fmt.Sprintf("%d", account.ID), file.Filename) + + if _, err := os.Stat(p); err != nil { + err = ctx.SaveUploadedFile(file, p) + if err != nil { + ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not save file"))) + return + + } + } else { + ctx.JSON(http.StatusConflict, errorResponse(errors.New("filename already exists"))) + return + } +} diff --git a/bff/gw/server.go b/bff/gw/server.go new file mode 100644 index 0000000..c544652 --- /dev/null +++ b/bff/gw/server.go @@ -0,0 +1,47 @@ +package gw + +import ( + "fmt" + "log" + "net/http" + + "github.com/gin-gonic/gin" + db "github.com/itsscb/df/bff/db/sqlc" + "github.com/itsscb/df/bff/gapi" + "github.com/itsscb/df/bff/token" + "github.com/itsscb/df/bff/util" +) + +type Server struct { + Grpc gapi.Server + store db.Store + config util.Config + tokenMaker token.Maker + swaggerFS http.FileSystem +} + +func NewServer(config util.Config, store db.Store, swaggerFS http.FileSystem) (*Server, error) { + gprcServer, err := gapi.NewServer(config, store) + if err != nil { + log.Fatal("cannot create gateway gPRC server") + } + + tokenMaker, err := token.NewPasetoMaker(config.TokenPrivateKeyHex) + if err != nil { + return nil, fmt.Errorf("cannot create token maker for gateway server: %w", err) + } + + server := &Server{ + Grpc: *gprcServer, + store: store, + config: config, + tokenMaker: tokenMaker, + swaggerFS: swaggerFS, + } + + return server, nil +} + +func errorResponse(err error) gin.H { + return gin.H{"error": err.Error()} +} diff --git a/bff/main.go b/bff/main.go index 46a8b59..bb672a2 100644 --- a/bff/main.go +++ b/bff/main.go @@ -11,10 +11,12 @@ import ( "net/http" "time" + "github.com/gin-gonic/gin" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/itsscb/df/bff/api" db "github.com/itsscb/df/bff/db/sqlc" "github.com/itsscb/df/bff/gapi" + "github.com/itsscb/df/bff/gw" "github.com/itsscb/df/bff/pb" "github.com/itsscb/df/bff/util" _ "github.com/lib/pq" @@ -109,11 +111,16 @@ func runGRPCServer(config util.Config, store db.Store) { } func runGatewayServer(config util.Config, store db.Store, swaggerFS http.FileSystem) { - server, err := gapi.NewServer(config, store) + server, err := gw.NewServer(config, store, swaggerFS) if err != nil { log.Fatal("cannot create server") } + // server, err := gapi.NewServer(config, store) + // if err != nil { + // log.Fatal("cannot create server") + // } + jsonOption := runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ MarshalOptions: protojson.MarshalOptions{ UseProtoNames: true, @@ -129,16 +136,15 @@ func runGatewayServer(config util.Config, store db.Store, swaggerFS http.FileSys ctx, cancel := context.WithCancel(context.Background()) defer cancel() - err = pb.RegisterDfHandlerServer(ctx, grpcMux, server) + err = pb.RegisterDfHandlerServer(ctx, grpcMux, &server.Grpc) if err != nil { log.Fatal("cannot register handler server") } - mux := http.NewServeMux() - mux.Handle("/", grpcMux) - - swaggerHandler := http.StripPrefix("/swagger/", http.FileServer(swaggerFS)) - mux.Handle("/swagger/", swaggerHandler) + mux := gin.New() + mux.Group("v1/*{grpc_gateway}").Any("", gin.WrapH(grpcMux)) + mux.POST("documents/upload", server.UploadDocument) + mux.StaticFS("/swagger/", swaggerFS) listener, err := net.Listen("tcp", config.HTTPServerAddress) if err != nil { diff --git a/bff/pb/document.pb.go b/bff/pb/document.pb.go new file mode 100644 index 0000000..ef779b8 --- /dev/null +++ b/bff/pb/document.pb.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: document.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PersonId *uint64 `protobuf:"varint,1,opt,name=person_id,json=personId,proto3,oneof" json:"person_id,omitempty"` + MailId *uint64 `protobuf:"varint,2,opt,name=mail_id,json=mailId,proto3,oneof" json:"mail_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` + Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"` + Valid bool `protobuf:"varint,7,opt,name=valid,proto3" json:"valid,omitempty"` + ValidatedBy string `protobuf:"bytes,8,opt,name=validated_by,json=validatedBy,proto3" json:"validated_by,omitempty"` + ValidDate *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=valid_date,json=validDate,proto3" json:"valid_date,omitempty"` + Creator string `protobuf:"bytes,10,opt,name=creator,proto3" json:"creator,omitempty"` + Created *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created,proto3" json:"created,omitempty"` + Changer string `protobuf:"bytes,12,opt,name=changer,proto3" json:"changer,omitempty"` + Changed *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=changed,proto3" json:"changed,omitempty"` + Id uint64 `protobuf:"varint,14,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_document_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_document_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_document_proto_rawDescGZIP(), []int{0} +} + +func (x *Document) GetPersonId() uint64 { + if x != nil && x.PersonId != nil { + return *x.PersonId + } + return 0 +} + +func (x *Document) GetMailId() uint64 { + if x != nil && x.MailId != nil { + return *x.MailId + } + return 0 +} + +func (x *Document) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Document) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Document) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Document) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Document) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + +func (x *Document) GetValidatedBy() string { + if x != nil { + return x.ValidatedBy + } + return "" +} + +func (x *Document) GetValidDate() *timestamppb.Timestamp { + if x != nil { + return x.ValidDate + } + return nil +} + +func (x *Document) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Document) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *Document) GetChanger() string { + if x != nil { + return x.Changer + } + return "" +} + +func (x *Document) GetChanged() *timestamppb.Timestamp { + if x != nil { + return x.Changed + } + return nil +} + +func (x *Document) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +var File_document_proto protoreflect.FileDescriptor + +var file_document_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x04, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x07, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x88, + 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x56, 0x0a, 0x0a, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, + 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, + 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x44, 0x61, 0x74, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x51, 0x0a, 0x07, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, + 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, + 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x32, 0x30, 0x32, + 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, + 0x5a, 0x22, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x0f, 0x92, 0x41, 0x0c, + 0x0a, 0x0a, 0x2a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, + 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_document_proto_rawDescOnce sync.Once + file_document_proto_rawDescData = file_document_proto_rawDesc +) + +func file_document_proto_rawDescGZIP() []byte { + file_document_proto_rawDescOnce.Do(func() { + file_document_proto_rawDescData = protoimpl.X.CompressGZIP(file_document_proto_rawDescData) + }) + return file_document_proto_rawDescData +} + +var file_document_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_document_proto_goTypes = []interface{}{ + (*Document)(nil), // 0: pb.Document + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_document_proto_depIdxs = []int32{ + 1, // 0: pb.Document.valid_date:type_name -> google.protobuf.Timestamp + 1, // 1: pb.Document.created:type_name -> google.protobuf.Timestamp + 1, // 2: pb.Document.changed:type_name -> google.protobuf.Timestamp + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_document_proto_init() } +func file_document_proto_init() { + if File_document_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_document_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_document_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_document_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_document_proto_goTypes, + DependencyIndexes: file_document_proto_depIdxs, + MessageInfos: file_document_proto_msgTypes, + }.Build() + File_document_proto = out.File + file_document_proto_rawDesc = nil + file_document_proto_goTypes = nil + file_document_proto_depIdxs = nil +} diff --git a/bff/pb/rpc_upload_document.pb.go b/bff/pb/rpc_upload_document.pb.go new file mode 100644 index 0000000..654a21a --- /dev/null +++ b/bff/pb/rpc_upload_document.pb.go @@ -0,0 +1,249 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_upload_document.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UploadDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + File []byte `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` + PersonId *uint64 `protobuf:"varint,2,opt,name=person_id,json=personId,proto3,oneof" json:"person_id,omitempty"` + MailId *uint64 `protobuf:"varint,3,opt,name=mail_id,json=mailId,proto3,oneof" json:"mail_id,omitempty"` +} + +func (x *UploadDocumentRequest) Reset() { + *x = UploadDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_upload_document_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadDocumentRequest) ProtoMessage() {} + +func (x *UploadDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_upload_document_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadDocumentRequest.ProtoReflect.Descriptor instead. +func (*UploadDocumentRequest) Descriptor() ([]byte, []int) { + return file_rpc_upload_document_proto_rawDescGZIP(), []int{0} +} + +func (x *UploadDocumentRequest) GetFile() []byte { + if x != nil { + return x.File + } + return nil +} + +func (x *UploadDocumentRequest) GetPersonId() uint64 { + if x != nil && x.PersonId != nil { + return *x.PersonId + } + return 0 +} + +func (x *UploadDocumentRequest) GetMailId() uint64 { + if x != nil && x.MailId != nil { + return *x.MailId + } + return 0 +} + +type UploadDocumentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` +} + +func (x *UploadDocumentResponse) Reset() { + *x = UploadDocumentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_upload_document_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadDocumentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadDocumentResponse) ProtoMessage() {} + +func (x *UploadDocumentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_upload_document_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadDocumentResponse.ProtoReflect.Descriptor instead. +func (*UploadDocumentResponse) Descriptor() ([]byte, []int) { + return file_rpc_upload_document_proto_rawDescGZIP(), []int{1} +} + +func (x *UploadDocumentResponse) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +var File_rpc_upload_document_proto protoreflect.FileDescriptor + +var file_rpc_upload_document_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x91, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x0a, + 0x09, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x00, 0x52, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x1c, 0x0a, 0x07, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x3a, 0x89, 0x01, + 0x92, 0x41, 0x85, 0x01, 0x0a, 0x42, 0x2a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, + 0x50, 0x5d, 0x32, 0x1d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x61, 0x20, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, + 0x5d, 0xd2, 0x01, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x32, 0x3f, 0x7b, 0x22, 0x66, 0x69, 0x6c, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, + 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x31, + 0x30, 0x31, 0x30, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x61, 0x69, 0x6c, + 0x5f, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, 0x2a, 0x17, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_upload_document_proto_rawDescOnce sync.Once + file_rpc_upload_document_proto_rawDescData = file_rpc_upload_document_proto_rawDesc +) + +func file_rpc_upload_document_proto_rawDescGZIP() []byte { + file_rpc_upload_document_proto_rawDescOnce.Do(func() { + file_rpc_upload_document_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_upload_document_proto_rawDescData) + }) + return file_rpc_upload_document_proto_rawDescData +} + +var file_rpc_upload_document_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_upload_document_proto_goTypes = []interface{}{ + (*UploadDocumentRequest)(nil), // 0: pb.UploadDocumentRequest + (*UploadDocumentResponse)(nil), // 1: pb.UploadDocumentResponse + (*Document)(nil), // 2: pb.Document +} +var file_rpc_upload_document_proto_depIdxs = []int32{ + 2, // 0: pb.UploadDocumentResponse.document:type_name -> pb.Document + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpc_upload_document_proto_init() } +func file_rpc_upload_document_proto_init() { + if File_rpc_upload_document_proto != nil { + return + } + file_document_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_upload_document_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_upload_document_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadDocumentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_rpc_upload_document_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_upload_document_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_upload_document_proto_goTypes, + DependencyIndexes: file_rpc_upload_document_proto_depIdxs, + MessageInfos: file_rpc_upload_document_proto_msgTypes, + }.Build() + File_rpc_upload_document_proto = out.File + file_rpc_upload_document_proto_rawDesc = nil + file_rpc_upload_document_proto_goTypes = nil + file_rpc_upload_document_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index ea1e889..95e0f84 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -62,177 +62,224 @@ var file_service_df_proto_rawDesc = []byte{ 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x72, 0x70, 0x63, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe7, 0x13, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, - 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, - 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0c, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, - 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, - 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x37, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, - 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x0d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, - 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, - 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x9e, 0x01, 0x0a, 0x14, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, - 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xbd, 0x19, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, + 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0xa4, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x2f, 0x12, + 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, + 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x7c, 0x0a, 0x0c, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x39, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, - 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x7c, 0x0a, 0x0c, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x32, 0x19, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x38, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, - 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0c, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, - 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, + 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, + 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4f, 0x92, 0x41, 0x27, 0x12, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x55, 0x92, 0x41, 0x2d, 0x12, 0x19, 0x47, 0x65, 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x96, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x2e, + 0x12, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, + 0x5b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x5d, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x12, 0x7f, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, 0x10, 0x12, 0x0e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, + 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x64, 0x92, 0x41, 0x33, 0x12, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, + 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, + 0x12, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, + 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, 0x12, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, 0x10, 0x0a, + 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x32, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x12, 0x84, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, + 0x92, 0x41, 0x24, 0x12, 0x10, 0x47, 0x65, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, + 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x0c, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, + 0x92, 0x41, 0x27, 0x12, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, + 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x5e, 0x92, 0x41, 0x2e, 0x12, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, + 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x77, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3a, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, - 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x83, - 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x25, 0x12, 0x11, 0x47, 0x65, 0x74, 0x20, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x12, 0x99, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x28, 0x12, 0x14, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, + 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa4, + 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x2f, 0x12, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, + 0x22, 0x12, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xb0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x67, 0x92, 0x41, 0x30, 0x12, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x20, 0x62, 0x79, 0x20, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, + 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xb9, 0x02, 0x0a, + 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xef, 0x01, 0x92, 0x41, 0xcf, 0x01, 0x12, 0x1b, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, + 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, 0x1a, 0x9d, 0x01, 0x54, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x69, 0x61, 0x20, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, + 0x2e, 0x20, 0x54, 0x72, 0x79, 0x20, 0x60, 0x60, 0x60, 0x63, 0x75, 0x72, 0x6c, 0x20, 0x2d, 0x58, + 0x20, 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2d, 0x48, 0x20, 0x22, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, + 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x66, 0x69, 0x6c, + 0x65, 0x3d, 0x40, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, + 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x55, 0x52, 0x49, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x60, 0x60, 0x60, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x81, - 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x92, 0x41, 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x92, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x92, 0x41, - 0x12, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x7b, 0x70, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, - 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, - 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, - 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, - 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, - 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, + 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, + 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, + 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, + 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, + 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -256,26 +303,28 @@ var file_service_df_proto_goTypes = []interface{}{ (*ListPaymentsRequest)(nil), // 17: pb.ListPaymentsRequest (*UpdatePaymentRequest)(nil), // 18: pb.UpdatePaymentRequest (*ListReturnsLogRequest)(nil), // 19: pb.ListReturnsLogRequest - (*LoginResponse)(nil), // 20: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 21: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 22: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 23: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 24: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 25: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 26: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 27: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 28: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 29: pb.CreatePersonResponse - (*UpdatePersonResponse)(nil), // 30: pb.UpdatePersonResponse - (*GetPersonResponse)(nil), // 31: pb.GetPersonResponse - (*DeletePersonResponse)(nil), // 32: pb.DeletePersonResponse - (*ListPersonsResponse)(nil), // 33: pb.ListPersonsResponse - (*CreatePaymentResponse)(nil), // 34: pb.CreatePaymentResponse - (*GetPaymentResponse)(nil), // 35: pb.GetPaymentResponse - (*DeletePaymentResponse)(nil), // 36: pb.DeletePaymentResponse - (*ListPaymentsResponse)(nil), // 37: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 38: pb.UpdatePaymentResponse - (*ListReturnsLogResponse)(nil), // 39: pb.ListReturnsLogResponse + (*UploadDocumentRequest)(nil), // 20: pb.UploadDocumentRequest + (*LoginResponse)(nil), // 21: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 22: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 23: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 24: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 25: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 26: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 27: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 28: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 29: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 30: pb.CreatePersonResponse + (*UpdatePersonResponse)(nil), // 31: pb.UpdatePersonResponse + (*GetPersonResponse)(nil), // 32: pb.GetPersonResponse + (*DeletePersonResponse)(nil), // 33: pb.DeletePersonResponse + (*ListPersonsResponse)(nil), // 34: pb.ListPersonsResponse + (*CreatePaymentResponse)(nil), // 35: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 36: pb.GetPaymentResponse + (*DeletePaymentResponse)(nil), // 37: pb.DeletePaymentResponse + (*ListPaymentsResponse)(nil), // 38: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 39: pb.UpdatePaymentResponse + (*ListReturnsLogResponse)(nil), // 40: pb.ListReturnsLogResponse + (*UploadDocumentResponse)(nil), // 41: pb.UploadDocumentResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -298,28 +347,30 @@ var file_service_df_proto_depIdxs = []int32{ 17, // 17: pb.df.ListPayments:input_type -> pb.ListPaymentsRequest 18, // 18: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest 19, // 19: pb.df.ListReturnsLog:input_type -> pb.ListReturnsLogRequest - 20, // 20: pb.df.Login:output_type -> pb.LoginResponse - 21, // 21: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 22, // 22: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 23, // 23: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 24, // 24: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 25, // 25: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 26, // 26: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 27, // 27: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 28, // 28: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 29, // 29: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 30, // 30: pb.df.UpdatePerson:output_type -> pb.UpdatePersonResponse - 31, // 31: pb.df.GetPerson:output_type -> pb.GetPersonResponse - 32, // 32: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse - 33, // 33: pb.df.ListPersons:output_type -> pb.ListPersonsResponse - 34, // 34: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 35, // 35: pb.df.GetPayment:output_type -> pb.GetPaymentResponse - 36, // 36: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse - 37, // 37: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 38, // 38: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 39, // 39: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse - 20, // [20:40] is the sub-list for method output_type - 0, // [0:20] is the sub-list for method input_type + 20, // 20: pb.df.UploadDocument:input_type -> pb.UploadDocumentRequest + 21, // 21: pb.df.Login:output_type -> pb.LoginResponse + 22, // 22: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 23, // 23: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 24, // 24: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 25, // 25: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 26, // 26: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 27, // 27: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 28, // 28: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 29, // 29: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 30, // 30: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 31, // 31: pb.df.UpdatePerson:output_type -> pb.UpdatePersonResponse + 32, // 32: pb.df.GetPerson:output_type -> pb.GetPersonResponse + 33, // 33: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse + 34, // 34: pb.df.ListPersons:output_type -> pb.ListPersonsResponse + 35, // 35: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 36, // 36: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 37, // 37: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse + 38, // 38: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 39, // 39: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 40, // 40: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse + 41, // 41: pb.df.UploadDocument:output_type -> pb.UploadDocumentResponse + 21, // [21:42] is the sub-list for method output_type + 0, // [0:21] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -350,6 +401,7 @@ func file_service_df_proto_init() { file_rpc_refresh_token_proto_init() file_rpc_block_session_proto_init() file_rpc_list_returns_log_by_person_id_proto_init() + file_rpc_upload_document_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index c2cfd30..6c61027 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -875,6 +875,40 @@ func local_request_Df_ListReturnsLog_0(ctx context.Context, marshaler runtime.Ma } +func request_Df_UploadDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UploadDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_UploadDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadDocumentRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UploadDocument(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDfHandlerServer registers the http handlers for service Df to "mux". // UnaryRPC :call DfServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1381,6 +1415,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Df_UploadDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/UploadDocument", runtime.WithHTTPPathPattern("/documents/upload")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_UploadDocument_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UploadDocument_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1862,6 +1921,28 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Df_UploadDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/UploadDocument", runtime.WithHTTPPathPattern("/documents/upload")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_UploadDocument_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_UploadDocument_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1905,6 +1986,8 @@ var ( pattern_Df_UpdatePayment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payments", "update_payment"}, "")) pattern_Df_ListReturnsLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "returns_log", "list_returns_log", "person_id"}, "")) + + pattern_Df_UploadDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"documents", "upload"}, "")) ) var ( @@ -1947,4 +2030,6 @@ var ( forward_Df_UpdatePayment_0 = runtime.ForwardResponseMessage forward_Df_ListReturnsLog_0 = runtime.ForwardResponseMessage + + forward_Df_UploadDocument_0 = runtime.ForwardResponseMessage ) diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index f2d6c62..e5d300c 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -39,6 +39,7 @@ const ( Df_ListPayments_FullMethodName = "/pb.df/ListPayments" Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" Df_ListReturnsLog_FullMethodName = "/pb.df/ListReturnsLog" + Df_UploadDocument_FullMethodName = "/pb.df/UploadDocument" ) // DfClient is the client API for Df service. @@ -65,6 +66,7 @@ type DfClient interface { ListPayments(ctx context.Context, in *ListPaymentsRequest, opts ...grpc.CallOption) (*ListPaymentsResponse, error) UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) ListReturnsLog(ctx context.Context, in *ListReturnsLogRequest, opts ...grpc.CallOption) (*ListReturnsLogResponse, error) + UploadDocument(ctx context.Context, in *UploadDocumentRequest, opts ...grpc.CallOption) (*UploadDocumentResponse, error) } type dfClient struct { @@ -255,6 +257,15 @@ func (c *dfClient) ListReturnsLog(ctx context.Context, in *ListReturnsLogRequest return out, nil } +func (c *dfClient) UploadDocument(ctx context.Context, in *UploadDocumentRequest, opts ...grpc.CallOption) (*UploadDocumentResponse, error) { + out := new(UploadDocumentResponse) + err := c.cc.Invoke(ctx, Df_UploadDocument_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DfServer is the server API for Df service. // All implementations must embed UnimplementedDfServer // for forward compatibility @@ -279,6 +290,7 @@ type DfServer interface { ListPayments(context.Context, *ListPaymentsRequest) (*ListPaymentsResponse, error) UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) ListReturnsLog(context.Context, *ListReturnsLogRequest) (*ListReturnsLogResponse, error) + UploadDocument(context.Context, *UploadDocumentRequest) (*UploadDocumentResponse, error) mustEmbedUnimplementedDfServer() } @@ -346,6 +358,9 @@ func (UnimplementedDfServer) UpdatePayment(context.Context, *UpdatePaymentReques func (UnimplementedDfServer) ListReturnsLog(context.Context, *ListReturnsLogRequest) (*ListReturnsLogResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListReturnsLog not implemented") } +func (UnimplementedDfServer) UploadDocument(context.Context, *UploadDocumentRequest) (*UploadDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadDocument not implemented") +} func (UnimplementedDfServer) mustEmbedUnimplementedDfServer() {} // UnsafeDfServer may be embedded to opt out of forward compatibility for this service. @@ -719,6 +734,24 @@ func _Df_ListReturnsLog_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Df_UploadDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).UploadDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_UploadDocument_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).UploadDocument(ctx, req.(*UploadDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Df_ServiceDesc is the grpc.ServiceDesc for Df service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -806,6 +839,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListReturnsLog", Handler: _Df_ListReturnsLog_Handler, }, + { + MethodName: "UploadDocument", + Handler: _Df_UploadDocument_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_df.proto", diff --git a/bff/proto/document.proto b/bff/proto/document.proto new file mode 100644 index 0000000..3fe8be5 --- /dev/null +++ b/bff/proto/document.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message Document { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Document"; + }; + }; + optional uint64 person_id = 1; + optional uint64 mail_id = 2; + string name = 3; + string type = 4; + string path = 5; + string url = 6; + bool valid = 7; + string validated_by = 8; + google.protobuf.Timestamp valid_date = 9 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; + string creator = 10; + google.protobuf.Timestamp created = 11 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; + string changer = 12; + google.protobuf.Timestamp changed = 13 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"2023-10-05T00:00:00Z\"" + }]; + uint64 id = 14; +} \ No newline at end of file diff --git a/bff/proto/rpc_upload_document.proto b/bff/proto/rpc_upload_document.proto new file mode 100644 index 0000000..07059c1 --- /dev/null +++ b/bff/proto/rpc_upload_document.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "document.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message UploadDocumentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "UploadDocument [only HTTP]"; + description: "Upload a Document [only HTTP]"; + required: [ + "file" + ]; + }; + example: "{\"file\": \"10101010101010010100101010010101\", \"person_id\": \"1\" }"; + }; + bytes file = 1; + optional uint64 person_id = 2; + optional uint64 mail_id = 3; +} + +message UploadDocumentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "UploadDocument Response"; + }; + }; + Document document = 1; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index 6269472..c18f68b 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -30,6 +30,8 @@ import "rpc_block_session.proto"; import "rpc_list_returns_log_by_person_id.proto"; +import "rpc_upload_document.proto"; + option go_package = "github.com/itsscb/df/pb"; @@ -81,6 +83,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/sessions/list_sessions/{account_id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List Sessions by account_id" security: { security_requirement: { key: "BearerAuth"; @@ -95,6 +98,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Block Session by ID" security: { security_requirement: { key: "BearerAuth"; @@ -109,6 +113,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { // get: "/v1/accounts/{id=id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Get Account by account_id" security: { security_requirement: { key: "BearerAuth"; @@ -122,6 +127,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/accounts/list_accounts" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List Accounts [admin only]" security: { security_requirement: { key: "BearerAuth"; @@ -135,13 +141,17 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { post: "/v1/accounts/create_account" body: "*" }; - }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Create Account" + }; + }; rpc UpdateAccount (UpdateAccountRequest) returns (UpdateAccountResponse) { option (google.api.http) = { patch: "/v1/accounts/update_account" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Update Account" security: { security_requirement: { key: "BearerAuth"; @@ -156,6 +166,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Update Account Privacy Settings" security: { security_requirement: { key: "BearerAuth"; @@ -170,6 +181,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Create Person" security: { security_requirement: { key: "BearerAuth"; @@ -184,6 +196,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Update Person" security: { security_requirement: { key: "BearerAuth"; @@ -197,6 +210,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/persons/get_person/{id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Get Person by ID" security: { security_requirement: { key: "BearerAuth"; @@ -210,6 +224,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { delete: "/v1/persons/delete_person/{id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Delete Person by ID" security: { security_requirement: { key: "BearerAuth"; @@ -223,6 +238,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/persons/list_persons/{account_id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List Persons by account_id" security: { security_requirement: { key: "BearerAuth"; @@ -237,6 +253,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Create Payment" security: { security_requirement: { key: "BearerAuth"; @@ -250,6 +267,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/payments/get_payment/{id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Get Payment by ID" security: { security_requirement: { key: "BearerAuth"; @@ -263,6 +281,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { delete: "/v1/payments/delete_payment/{id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Delete Payment by ID" security: { security_requirement: { key: "BearerAuth"; @@ -276,6 +295,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/payments/list_payments/{account_id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List Payments by account_id" security: { security_requirement: { key: "BearerAuth"; @@ -290,6 +310,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Update Payment" security: { security_requirement: { key: "BearerAuth"; @@ -303,6 +324,23 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { get: "/v1/returns_log/list_returns_log/{person_id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List ReturnsLog by person_id" + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; + rpc UploadDocument (UploadDocumentRequest) returns (UploadDocumentResponse) { + option (google.api.http) = { + post: "/documents/upload" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Upload Document [only HTTP]" + description: "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" \"http://{serverURI}/documents/upload\"```" security: { security_requirement: { key: "BearerAuth"; From 3d6d87854ed88808e9ff9524ed8e082dc4a2f7e9 Mon Sep 17 00:00:00 2001 From: itsscb Date: Thu, 12 Oct 2023 00:30:50 +0200 Subject: [PATCH 12/15] ft/adds docker-compose volumes prepares fileupload - Files should be saved into subdirs --- bff/Dockerfile | 1 + bff/docker-compose.yaml | 9 +++++++-- bff/gw/document.go | 30 +++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/bff/Dockerfile b/bff/Dockerfile index c5c01b3..618139f 100644 --- a/bff/Dockerfile +++ b/bff/Dockerfile @@ -7,6 +7,7 @@ RUN go build -o main main.go # Run stage FROM alpine:3.18 WORKDIR /app +RUN mkdir files COPY --from=builder /app/main . COPY app.env . ENV DB_SOURCE=postgresql://root:secret@postgres:5432/df?sslmode=disable diff --git a/bff/docker-compose.yaml b/bff/docker-compose.yaml index 9a09f69..9f6b7a2 100644 --- a/bff/docker-compose.yaml +++ b/bff/docker-compose.yaml @@ -8,8 +8,8 @@ services: - POSTGRES_DB=df ports: - "5432:5432" - # volumes: - # - ./db/migration:/docker-entrypoint-initdb.d + volumes: + - data-volume:/var/lib/postgresql/data api: build: context: . @@ -17,8 +17,13 @@ services: ports: - "8080:8080" - "9090:9090" + volumes: + - ./files:/app/files/:Z environment: - DB_SOURCE=postgresql://root:secret@postgres:5432/df?sslmode=disable depends_on: - postgres command: [ "/app/main" ] + +volumes: + data-volume: \ No newline at end of file diff --git a/bff/gw/document.go b/bff/gw/document.go index ef04f7b..0b9697d 100644 --- a/bff/gw/document.go +++ b/bff/gw/document.go @@ -11,6 +11,11 @@ import ( "github.com/gin-gonic/gin" ) +// type uploadDocumentRequest struct { +// PersonID uint64 `json:"person_id"` +// MailID uint64 `json:"mail_id"` +// } + func (server *Server) UploadDocument(ctx *gin.Context) { authHeader := ctx.GetHeader("authorization") @@ -35,13 +40,36 @@ func (server *Server) UploadDocument(ctx *gin.Context) { return } + // TODO: FileUpload with POST-Values + // bodyData, _ := io.ReadAll(ctx.Request.Body) + // slog.Info("Document", slog.String("body", fmt.Sprintf("%#v", string(bodyData)))) + file, err := ctx.FormFile("file") if err != nil { ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not parse file"))) return } - p := filepath.Join("./files", fmt.Sprintf("%d", account.ID), file.Filename) + targetDir := filepath.Join("./files", fmt.Sprintf("%d", account.ID)) + + // var req *uploadDocumentRequest + // _ = ctx.ShouldBindJSON(&req) + + // if req != nil { + // if req.MailID <= 0 && req.PersonID <= 0 { + // ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("document can't be assigned to both person_id AND mail_id"))) + // return + // } + + // if req.MailID > 0 { + // targetDir = filepath.Join(targetDir, "mail", fmt.Sprintf("%d", req.MailID)) + // } + // if req.PersonID > 0 { + // targetDir = filepath.Join(targetDir, "person", fmt.Sprintf("%d", req.PersonID)) + // } + // } + + p := filepath.Join(targetDir, file.Filename) if _, err := os.Stat(p); err != nil { err = ctx.SaveUploadedFile(file, p) From cf4e84380e72968b14774b8b26207ff535c2a913 Mon Sep 17 00:00:00 2001 From: itsscb Date: Sun, 15 Oct 2023 06:17:04 +0200 Subject: [PATCH 13/15] rf/replaces email with account_id in session and payload --- bff/api/account.go | 12 +- bff/api/account_test.go | 38 ++-- bff/api/middleware_test.go | 12 +- bff/api/session.go | 12 +- bff/api/token.go | 4 +- bff/db/migration/000001_init_schema.up.sql | 4 +- bff/db/mock/store.go | 2 +- bff/db/query/session.sql | 4 +- bff/db/sqlc/account.sql.go | 2 +- bff/db/sqlc/db.go | 2 +- bff/db/sqlc/document.sql.go | 2 +- bff/db/sqlc/mail.sql.go | 2 +- bff/db/sqlc/models.go | 4 +- bff/db/sqlc/payment.sql.go | 2 +- bff/db/sqlc/person.sql.go | 2 +- bff/db/sqlc/provider.sql.go | 2 +- bff/db/sqlc/querier.go | 4 +- bff/db/sqlc/return.sql.go | 2 +- bff/db/sqlc/returnsLog.sql.go | 2 +- bff/db/sqlc/session.sql.go | 26 +-- bff/doc/swagger/df.swagger.json | 14 +- bff/gapi/authorization.go | 2 +- bff/gapi/converter.go | 2 +- bff/gapi/rpc_block_session.go | 6 +- bff/gapi/rpc_create_payment.go | 10 +- bff/gapi/rpc_create_person.go | 10 +- bff/gapi/rpc_delete_payment.go | 10 +- bff/gapi/rpc_delete_person.go | 10 +- bff/gapi/rpc_get_account.go | 4 +- bff/gapi/rpc_get_payment.go | 8 +- bff/gapi/rpc_get_person.go | 8 +- bff/gapi/rpc_list_accounts.go | 2 +- bff/gapi/rpc_list_payments.go | 8 +- bff/gapi/rpc_list_persons.go | 8 +- bff/gapi/rpc_list_returns_log_by_person_id.go | 8 +- bff/gapi/rpc_list_sessions.go | 10 +- bff/gapi/rpc_login.go | 8 +- bff/gapi/rpc_refresh_token.go | 10 +- bff/gapi/rpc_update_account.go | 15 +- bff/gapi/rpc_update_account_privacy.go | 8 +- bff/gapi/rpc_update_payment.go | 12 +- bff/gapi/rpc_update_person.go | 12 +- bff/gw/document.go | 2 +- bff/pb/rpc_login.pb.go | 169 +++++++++--------- bff/pb/session.pb.go | 126 ++++++------- bff/proto/rpc_login.proto | 6 +- bff/proto/session.proto | 4 +- bff/sqlc.yaml | 2 + bff/token/maker.go | 2 +- bff/token/paseto_maker.go | 15 +- bff/token/paseto_maker_test.go | 8 +- bff/token/payload.go | 6 +- 52 files changed, 338 insertions(+), 327 deletions(-) diff --git a/bff/api/account.go b/bff/api/account.go index e9c9480..aa6a30d 100644 --- a/bff/api/account.go +++ b/bff/api/account.go @@ -86,7 +86,7 @@ func (server *Server) getAccount(ctx *gin.Context) { } authPayload := ctx.MustGet(authorizationPayloadKey).(*token.Payload) - if account.Email != authPayload.Email { + if account.ID != authPayload.AccountID { err := errors.New("account doesn't belong to the authenticated user") ctx.JSON(http.StatusUnauthorized, errorResponse(err)) return @@ -110,7 +110,7 @@ func (server *Server) listAccounts(ctx *gin.Context) { authPayload := ctx.MustGet(authorizationPayloadKey).(*token.Payload) - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if err == sql.ErrNoRows { ctx.JSON(http.StatusNotFound, errorResponse(err)) @@ -160,7 +160,7 @@ func (server *Server) updateAccountPrivacy(ctx *gin.Context) { } authPayload := ctx.MustGet(authorizationPayloadKey).(*token.Payload) - if account.Email != authPayload.Email { + if account.ID != authPayload.AccountID { err := errors.New("account doesn't belong to the authenticated user") ctx.JSON(http.StatusUnauthorized, errorResponse(err)) return @@ -168,7 +168,7 @@ func (server *Server) updateAccountPrivacy(ctx *gin.Context) { account, err = server.store.UpdateAccountPrivacyTx(ctx, db.UpdateAccountPrivacyTxParams{ ID: req.ID, - Changer: authPayload.Email, + Changer: account.Email, PrivacyAccepted: req.PrivacyAccepted, }) if err != nil { @@ -207,7 +207,7 @@ func (server *Server) updateAccount(ctx *gin.Context) { } authPayload := ctx.MustGet(authorizationPayloadKey).(*token.Payload) - if account.Email != authPayload.Email { + if account.ID != authPayload.AccountID { err := errors.New("account doesn't belong to the authenticated user") ctx.JSON(http.StatusUnauthorized, errorResponse(err)) return @@ -215,7 +215,7 @@ func (server *Server) updateAccount(ctx *gin.Context) { arg := db.UpdateAccountTxParams{ ID: req.ID, - Changer: authPayload.Email, + Changer: account.Email, Passwordhash: sql.NullString{ String: req.NewPassword, Valid: req.NewPassword != "", diff --git a/bff/api/account_test.go b/bff/api/account_test.go index 42cb105..b53a931 100644 --- a/bff/api/account_test.go +++ b/bff/api/account_test.go @@ -49,7 +49,7 @@ func TestCreateAccountAPI(t *testing.T) { "creator": account.Email, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { arg := db.CreateAccountTxParams{ @@ -110,7 +110,7 @@ func TestCreateAccountAPI(t *testing.T) { "email": account.Email, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -139,7 +139,7 @@ func TestCreateAccountAPI(t *testing.T) { "creator": account.Email, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -197,7 +197,7 @@ func TestGetAccountAPI(t *testing.T) { name: "OK", accountID: account.ID, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -214,7 +214,7 @@ func TestGetAccountAPI(t *testing.T) { name: "UnauthorizedUser", accountID: account.ID, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, "UnauthorizedUser", time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, 2, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -244,7 +244,7 @@ func TestGetAccountAPI(t *testing.T) { name: "NotFound", accountID: account.ID, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -260,7 +260,7 @@ func TestGetAccountAPI(t *testing.T) { name: "InternalError", accountID: account.ID, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -276,7 +276,7 @@ func TestGetAccountAPI(t *testing.T) { name: "InvalidID", accountID: 0, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -373,7 +373,7 @@ func TestUpdateAccountTxAPI(t *testing.T) { "lastname": newLastname, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { arg := db.UpdateAccountTxParams{ @@ -423,7 +423,7 @@ func TestUpdateAccountTxAPI(t *testing.T) { "email": account.Email, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -495,7 +495,7 @@ func TestListAccountsAPI(t *testing.T) { pageSize: n, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { arg := db.ListAccountsParams{ @@ -507,7 +507,7 @@ func TestListAccountsAPI(t *testing.T) { accountAdmin.PermissionLevel = 1 store.EXPECT(). - GetAccountByEmail(gomock.Any(), gomock.Eq(account.Email)). + GetAccount(gomock.Any(), gomock.Eq(account.ID)). Times(1). Return(accountAdmin, nil) @@ -542,7 +542,7 @@ func TestListAccountsAPI(t *testing.T) { name: "EmptyQuery", query: Query{}, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -560,7 +560,7 @@ func TestListAccountsAPI(t *testing.T) { pageSize: n, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -578,7 +578,7 @@ func TestListAccountsAPI(t *testing.T) { pageSize: 100000, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). @@ -640,7 +640,7 @@ func TestUpdateAccountPrivacyTxAPI(t *testing.T) { "privacy_accepted": true, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { trueBool := true @@ -687,7 +687,7 @@ func TestUpdateAccountPrivacyTxAPI(t *testing.T) { "privacy_accepted": true, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { trueBool := true @@ -735,7 +735,7 @@ func TestUpdateAccountPrivacyTxAPI(t *testing.T) { "privacy_accepted": false, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { falseBool := false @@ -784,7 +784,7 @@ func TestUpdateAccountPrivacyTxAPI(t *testing.T) { "id": account.ID, }, setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.Email, time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, account.ID, time.Minute) }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). diff --git a/bff/api/middleware_test.go b/bff/api/middleware_test.go index 7ac4683..f746c5a 100644 --- a/bff/api/middleware_test.go +++ b/bff/api/middleware_test.go @@ -19,13 +19,13 @@ func addAuthorization( request *http.Request, tokenMaker token.Maker, authorizationType string, - email string, + account_id uint64, duration time.Duration, ) { id, err := tokenMaker.NewTokenID() require.NoError(t, err) - token, payload, err := tokenMaker.CreateToken(email, id, duration) + token, payload, err := tokenMaker.CreateToken(account_id, id, duration) require.NoError(t, err) require.NotEmpty(t, payload) @@ -42,7 +42,7 @@ func TestAuthMiddleware(t *testing.T) { { name: "OK", setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, "user", time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, 1, time.Minute) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { require.Equal(t, http.StatusOK, recorder.Code) @@ -59,7 +59,7 @@ func TestAuthMiddleware(t *testing.T) { { name: "UnsupportedAuthorization", setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, "unsupported", "user", time.Minute) + addAuthorization(t, request, tokenMaker, "unsupported", 1, time.Minute) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { require.Equal(t, http.StatusUnauthorized, recorder.Code) @@ -68,7 +68,7 @@ func TestAuthMiddleware(t *testing.T) { { name: "InvalidAuthorizationFormat", setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, "", "user", time.Minute) + addAuthorization(t, request, tokenMaker, "", 1, time.Minute) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { require.Equal(t, http.StatusUnauthorized, recorder.Code) @@ -77,7 +77,7 @@ func TestAuthMiddleware(t *testing.T) { { name: "ExpiredToken", setupAuth: func(t *testing.T, request *http.Request, tokenMaker token.Maker) { - addAuthorization(t, request, tokenMaker, authorizationTypeBearer, "user", -time.Minute) + addAuthorization(t, request, tokenMaker, authorizationTypeBearer, 1, -time.Minute) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { require.Equal(t, http.StatusUnauthorized, recorder.Code) diff --git a/bff/api/session.go b/bff/api/session.go index 40ad207..ab7de2b 100644 --- a/bff/api/session.go +++ b/bff/api/session.go @@ -24,7 +24,7 @@ type loginAccountResponse struct { AccessTokenExpiresAt time.Time `json:"access_token_expires_at"` RefreshToken string `json:"refresh_token"` RefreshTokenExpiresAt time.Time `json:"refresh_token_expires_at"` - Email string `json:"email"` + AccountID uint64 `json:"account_id"` } func (server *Server) loginAccount(ctx *gin.Context) { @@ -55,13 +55,13 @@ func (server *Server) loginAccount(ctx *gin.Context) { ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("failed to create session token"))) } refreshToken, refreshPayload, err := server.tokenMaker.CreateToken( - account.Email, + account.ID, id, server.config.RefreshTokenDuration, ) accessToken, accessPayload, err := server.tokenMaker.CreateToken( - account.Email, + account.ID, id, server.config.AccessTokenDuration, ) @@ -73,7 +73,7 @@ func (server *Server) loginAccount(ctx *gin.Context) { session, err := server.store.CreateSession(ctx, db.CreateSessionParams{ ID: refreshPayload.ID, - Email: account.Email, + AccountID: refreshPayload.AccountID, RefreshToken: refreshToken, UserAgent: ctx.Request.UserAgent(), ClientIp: ctx.ClientIP(), @@ -91,7 +91,7 @@ func (server *Server) loginAccount(ctx *gin.Context) { AccessTokenExpiresAt: accessPayload.ExpiredAt, RefreshToken: refreshToken, RefreshTokenExpiresAt: refreshPayload.ExpiredAt, - Email: account.Email, + AccountID: refreshPayload.AccountID, } ctx.JSON(http.StatusOK, rsp) } @@ -130,7 +130,7 @@ func (server *Server) blockSession(ctx *gin.Context) { return } - if session.Email != payload.Email { + if session.AccountID != payload.AccountID { ctx.JSON(http.StatusUnauthorized, errorResponse(errors.New("unauthorized"))) return } diff --git a/bff/api/token.go b/bff/api/token.go index 3d16029..21a8821 100644 --- a/bff/api/token.go +++ b/bff/api/token.go @@ -48,7 +48,7 @@ func (server *Server) renewAccessToken(ctx *gin.Context) { return } - if session.Email != refreshPayload.Email { + if session.AccountID != refreshPayload.AccountID { err := fmt.Errorf("incorrect session user") ctx.JSON(http.StatusUnauthorized, errorResponse(err)) return @@ -71,7 +71,7 @@ func (server *Server) renewAccessToken(ctx *gin.Context) { ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("failed to create session token"))) } accessToken, accessPayload, err := server.tokenMaker.CreateToken( - refreshPayload.Email, + refreshPayload.AccountID, id, server.config.AccessTokenDuration, ) diff --git a/bff/db/migration/000001_init_schema.up.sql b/bff/db/migration/000001_init_schema.up.sql index 1186d43..42fcb62 100644 --- a/bff/db/migration/000001_init_schema.up.sql +++ b/bff/db/migration/000001_init_schema.up.sql @@ -35,7 +35,7 @@ CREATE TABLE "accounts" ( CREATE TABLE "sessions" ( "id" uuid UNIQUE PRIMARY KEY NOT NULL, - "email" varchar NOT NULL, + "account_id" bigint NOT NULL, "user_agent" varchar NOT NULL, "client_ip" varchar NOT NULL, "refresh_token" varchar NOT NULL, @@ -132,7 +132,7 @@ CREATE TABLE "returnsLog" ( "changed" timestamptz NOT NULL DEFAULT (now()) ); -ALTER TABLE "sessions" ADD FOREIGN KEY ("email") REFERENCES "accounts" ("email"); +ALTER TABLE "sessions" ADD FOREIGN KEY ("account_id") REFERENCES "accounts" ("id"); ALTER TABLE "persons" ADD FOREIGN KEY ("account_id") REFERENCES "accounts" ("id"); diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index 6c91468..b51b579 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -763,7 +763,7 @@ func (mr *MockStoreMockRecorder) ListReturnsLogsByPersonID(arg0, arg1 any) *gomo } // ListSessions mocks base method. -func (m *MockStore) ListSessions(arg0 context.Context, arg1 string) ([]db.Session, error) { +func (m *MockStore) ListSessions(arg0 context.Context, arg1 uint64) ([]db.Session, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListSessions", arg0, arg1) ret0, _ := ret[0].([]db.Session) diff --git a/bff/db/query/session.sql b/bff/db/query/session.sql index 56df86d..510ef55 100644 --- a/bff/db/query/session.sql +++ b/bff/db/query/session.sql @@ -1,7 +1,7 @@ -- name: CreateSession :one INSERT INTO sessions ( id, - email, + account_id, refresh_token, user_agent, client_ip, @@ -24,4 +24,4 @@ WHERE "id" = sqlc.arg(id); -- name: ListSessions :many SELECT * FROM sessions -WHERE email = sqlc.arg(email) AND is_blocked = false AND expires_at > now(); \ No newline at end of file +WHERE account_id = sqlc.arg(account_id) AND is_blocked = false AND expires_at > now(); \ No newline at end of file diff --git a/bff/db/sqlc/account.sql.go b/bff/db/sqlc/account.sql.go index 779da37..c5e1d0d 100644 --- a/bff/db/sqlc/account.sql.go +++ b/bff/db/sqlc/account.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: account.sql package db diff --git a/bff/db/sqlc/db.go b/bff/db/sqlc/db.go index 3d2b5bf..46fda54 100644 --- a/bff/db/sqlc/db.go +++ b/bff/db/sqlc/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 package db diff --git a/bff/db/sqlc/document.sql.go b/bff/db/sqlc/document.sql.go index e28b5ef..b7258c0 100644 --- a/bff/db/sqlc/document.sql.go +++ b/bff/db/sqlc/document.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: document.sql package db diff --git a/bff/db/sqlc/mail.sql.go b/bff/db/sqlc/mail.sql.go index b770e48..9c947a3 100644 --- a/bff/db/sqlc/mail.sql.go +++ b/bff/db/sqlc/mail.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: mail.sql package db diff --git a/bff/db/sqlc/models.go b/bff/db/sqlc/models.go index 7455b7d..592e2d2 100644 --- a/bff/db/sqlc/models.go +++ b/bff/db/sqlc/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 package db @@ -136,7 +136,7 @@ type ReturnsLog struct { type Session struct { ID uuid.UUID `json:"id"` - Email string `json:"email"` + AccountID uint64 `json:"account_id"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` RefreshToken string `json:"refresh_token"` diff --git a/bff/db/sqlc/payment.sql.go b/bff/db/sqlc/payment.sql.go index 4b1ee17..795bdf2 100644 --- a/bff/db/sqlc/payment.sql.go +++ b/bff/db/sqlc/payment.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: payment.sql package db diff --git a/bff/db/sqlc/person.sql.go b/bff/db/sqlc/person.sql.go index 8eb9693..6c5bbfd 100644 --- a/bff/db/sqlc/person.sql.go +++ b/bff/db/sqlc/person.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: person.sql package db diff --git a/bff/db/sqlc/provider.sql.go b/bff/db/sqlc/provider.sql.go index cbc92a8..15ca6cf 100644 --- a/bff/db/sqlc/provider.sql.go +++ b/bff/db/sqlc/provider.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: provider.sql package db diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index c48f10c..16d23ae 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 package db @@ -71,7 +71,7 @@ type Querier interface { ListReturns(ctx context.Context, arg ListReturnsParams) ([]Return, error) ListReturnsLogs(ctx context.Context, arg ListReturnsLogsParams) ([]ReturnsLog, error) ListReturnsLogsByPersonID(ctx context.Context, personID uint64) ([]ReturnsLog, error) - ListSessions(ctx context.Context, email string) ([]Session, error) + ListSessions(ctx context.Context, accountID uint64) ([]Session, error) UpdateAccount(ctx context.Context, arg UpdateAccountParams) (Account, error) UpdateAccountPrivacy(ctx context.Context, arg UpdateAccountPrivacyParams) (Account, error) UpdateDocument(ctx context.Context, arg UpdateDocumentParams) (Document, error) diff --git a/bff/db/sqlc/return.sql.go b/bff/db/sqlc/return.sql.go index a784141..3969183 100644 --- a/bff/db/sqlc/return.sql.go +++ b/bff/db/sqlc/return.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: return.sql package db diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index b7e31c9..96ccd60 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: returnsLog.sql package db diff --git a/bff/db/sqlc/session.sql.go b/bff/db/sqlc/session.sql.go index dec44e4..86da596 100644 --- a/bff/db/sqlc/session.sql.go +++ b/bff/db/sqlc/session.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.22.0 +// sqlc v1.21.0 // source: session.sql package db @@ -27,7 +27,7 @@ func (q *Queries) BlockSession(ctx context.Context, id uuid.UUID) error { const createSession = `-- name: CreateSession :one INSERT INTO sessions ( id, - email, + account_id, refresh_token, user_agent, client_ip, @@ -35,12 +35,12 @@ INSERT INTO sessions ( expires_at ) VALUES ( $1, $2, $3, $4, $5, $6, $7 -) RETURNING id, email, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at +) RETURNING id, account_id, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at ` type CreateSessionParams struct { ID uuid.UUID `json:"id"` - Email string `json:"email"` + AccountID uint64 `json:"account_id"` RefreshToken string `json:"refresh_token"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` @@ -51,7 +51,7 @@ type CreateSessionParams struct { func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) { row := q.db.QueryRowContext(ctx, createSession, arg.ID, - arg.Email, + arg.AccountID, arg.RefreshToken, arg.UserAgent, arg.ClientIp, @@ -61,7 +61,7 @@ func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (S var i Session err := row.Scan( &i.ID, - &i.Email, + &i.AccountID, &i.UserAgent, &i.ClientIp, &i.RefreshToken, @@ -73,7 +73,7 @@ func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (S } const getSession = `-- name: GetSession :one -SELECT id, email, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions +SELECT id, account_id, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions WHERE id = $1 LIMIT 1 ` @@ -82,7 +82,7 @@ func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error) var i Session err := row.Scan( &i.ID, - &i.Email, + &i.AccountID, &i.UserAgent, &i.ClientIp, &i.RefreshToken, @@ -94,12 +94,12 @@ func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error) } const listSessions = `-- name: ListSessions :many -SELECT id, email, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions -WHERE email = $1 AND is_blocked = false AND expires_at > now() +SELECT id, account_id, user_agent, client_ip, refresh_token, is_blocked, expires_at, created_at FROM sessions +WHERE account_id = $1 AND is_blocked = false AND expires_at > now() ` -func (q *Queries) ListSessions(ctx context.Context, email string) ([]Session, error) { - rows, err := q.db.QueryContext(ctx, listSessions, email) +func (q *Queries) ListSessions(ctx context.Context, accountID uint64) ([]Session, error) { + rows, err := q.db.QueryContext(ctx, listSessions, accountID) if err != nil { return nil, err } @@ -109,7 +109,7 @@ func (q *Queries) ListSessions(ctx context.Context, email string) ([]Session, er var i Session if err := rows.Scan( &i.ID, - &i.Email, + &i.AccountID, &i.UserAgent, &i.ClientIp, &i.RefreshToken, diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index 29f762d..e8e8896 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -1338,7 +1338,6 @@ "properties": { "email": { "type": "string", - "format": "email", "example": "john.doe@example.com" }, "password": { @@ -1378,10 +1377,10 @@ "type": "string", "format": "date-time" }, - "email": { + "accountId": { "type": "string", - "format": "email", - "example": "john.doe@example.com" + "format": "uint64", + "example": "1" } }, "title": "Login Response" @@ -1619,7 +1618,7 @@ "type": "object", "example": { "id": "1", - "email": "john.doe@example.com", + "account_id": "1", "refresh_token": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw", "expires_at": "2023-10-05T02:30:53Z", "created_at": "2023-10-05T01:20:11Z", @@ -1631,8 +1630,9 @@ "id": { "type": "string" }, - "email": { - "type": "string" + "accountId": { + "type": "string", + "format": "uint64" }, "userAgent": { "type": "string" diff --git a/bff/gapi/authorization.go b/bff/gapi/authorization.go index 196b9bc..4e1ac0f 100644 --- a/bff/gapi/authorization.go +++ b/bff/gapi/authorization.go @@ -60,7 +60,7 @@ func (server *Server) authorizeUser(ctx context.Context) (*token.Payload, error) } func (server *Server) isAdmin(ctx context.Context, payload *token.Payload) bool { - acc, err := server.store.GetAccountByEmail(ctx, payload.Email) + acc, err := server.store.GetAccount(ctx, payload.AccountID) if err != nil { fmt.Printf("could not verify admin: %#v", err) return false diff --git a/bff/gapi/converter.go b/bff/gapi/converter.go index a314e2d..a0b6d29 100644 --- a/bff/gapi/converter.go +++ b/bff/gapi/converter.go @@ -49,7 +49,7 @@ func convertPerson(person db.Person) *pb.Person { func convertSession(session db.Session) *pb.Session { return &pb.Session{ Id: session.ID.String(), - Email: session.Email, + AccountId: session.AccountID, ClientIp: session.ClientIp, UserAgent: session.UserAgent, RefreshToken: session.RefreshToken, diff --git a/bff/gapi/rpc_block_session.go b/bff/gapi/rpc_block_session.go index 5d1cd3d..3e6503e 100644 --- a/bff/gapi/rpc_block_session.go +++ b/bff/gapi/rpc_block_session.go @@ -31,11 +31,11 @@ func (server *Server) BlockSession(ctx context.Context, req *pb.BlockSessionRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "session not found") } - slog.Error("block_session (get)", slog.String("invoked_by", authPayload.Email), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) + slog.Error("block_session (get)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get session") } - if session.Email != authPayload.Email { + if session.AccountID != authPayload.AccountID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "session not found") } @@ -47,7 +47,7 @@ func (server *Server) BlockSession(ctx context.Context, req *pb.BlockSessionRequ err = server.store.BlockSession(ctx, uid) if err != nil { - slog.Error("block_session (db)", slog.String("invoked_by", authPayload.Email), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) + slog.Error("block_session (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.String("session_id", req.GetSessionId()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to block session") } diff --git a/bff/gapi/rpc_create_payment.go b/bff/gapi/rpc_create_payment.go index ab62dd5..ac50109 100644 --- a/bff/gapi/rpc_create_payment.go +++ b/bff/gapi/rpc_create_payment.go @@ -30,11 +30,11 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("create_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("create_payment (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -68,13 +68,13 @@ func (server *Server) CreatePayment(ctx context.Context, req *pb.CreatePaymentRe String: req.GetPaymentSystem(), }, Type: req.GetType(), - Creator: authPayload.Email, - Changer: authPayload.Email, + Creator: account.Email, + Changer: account.Email, } payment, err := server.store.CreatePayment(ctx, arg) if err != nil { - slog.Error("create_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("payment_category", req.GetPaymentCategory()), slog.String("error", err.Error())) + slog.Error("create_payment (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("payment_category", req.GetPaymentCategory()), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to create payment") } diff --git a/bff/gapi/rpc_create_person.go b/bff/gapi/rpc_create_person.go index 8979a19..dd11ebe 100644 --- a/bff/gapi/rpc_create_person.go +++ b/bff/gapi/rpc_create_person.go @@ -31,11 +31,11 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("create_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("create_person (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -50,13 +50,13 @@ func (server *Server) CreatePerson(ctx context.Context, req *pb.CreatePersonRequ Street: req.GetStreet(), Country: req.GetCountry(), Zip: req.GetZip(), - Creator: authPayload.Email, - Changer: authPayload.Email, + Creator: account.Email, + Changer: account.Email, } person, err := server.store.CreatePersonTx(ctx, arg) if err != nil { - slog.Error("create_person (db)", slog.String("invoked_by", authPayload.Email), slog.String("person", fmt.Sprintf("%s, %s", req.GetLastname(), req.GetFirstname())), slog.String("error", err.Error())) + slog.Error("create_person (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.String("person", fmt.Sprintf("%s, %s", req.GetLastname(), req.GetFirstname())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to create person") } diff --git a/bff/gapi/rpc_delete_payment.go b/bff/gapi/rpc_delete_payment.go index fbef65f..507dfa5 100644 --- a/bff/gapi/rpc_delete_payment.go +++ b/bff/gapi/rpc_delete_payment.go @@ -23,16 +23,16 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("delete_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_payment (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -43,7 +43,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "payment not found") } - slog.Error("delete_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_payment (get_payment)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get payment") } @@ -55,7 +55,7 @@ func (server *Server) DeletePayment(ctx context.Context, req *pb.DeletePaymentRe err = server.store.DeletePayment(ctx, req.GetId()) if err != nil { - slog.Error("delete_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_payment (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to delete payment") } diff --git a/bff/gapi/rpc_delete_person.go b/bff/gapi/rpc_delete_person.go index 7fec68e..b5c5fb9 100644 --- a/bff/gapi/rpc_delete_person.go +++ b/bff/gapi/rpc_delete_person.go @@ -23,16 +23,16 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("delete_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_person (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -43,7 +43,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "person not found") } - slog.Error("delete_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_person (get_person)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get person") } @@ -55,7 +55,7 @@ func (server *Server) DeletePerson(ctx context.Context, req *pb.DeletePersonRequ err = server.store.DeletePersonTx(ctx, person.ID) if err != nil { - slog.Error("delete_person (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("delete_person (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to delete person") } diff --git a/bff/gapi/rpc_get_account.go b/bff/gapi/rpc_get_account.go index 76b967a..6aa8f82 100644 --- a/bff/gapi/rpc_get_account.go +++ b/bff/gapi/rpc_get_account.go @@ -28,11 +28,11 @@ func (server *Server) GetAccount(ctx context.Context, req *pb.GetAccountRequest) if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("get_account (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("get_account (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } diff --git a/bff/gapi/rpc_get_payment.go b/bff/gapi/rpc_get_payment.go index 5291963..d43dc10 100644 --- a/bff/gapi/rpc_get_payment.go +++ b/bff/gapi/rpc_get_payment.go @@ -23,16 +23,16 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("get_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("get_payment (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -43,7 +43,7 @@ func (server *Server) GetPayment(ctx context.Context, req *pb.GetPaymentRequest) if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") } - slog.Error("get_payment (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("get_payment (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get payments") } diff --git a/bff/gapi/rpc_get_person.go b/bff/gapi/rpc_get_person.go index 339ef77..f400623 100644 --- a/bff/gapi/rpc_get_person.go +++ b/bff/gapi/rpc_get_person.go @@ -23,16 +23,16 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("get_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("get_person (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -43,7 +43,7 @@ func (server *Server) GetPerson(ctx context.Context, req *pb.GetPersonRequest) ( if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") } - slog.Error("get_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("get_person (get_person)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get persons") } diff --git a/bff/gapi/rpc_list_accounts.go b/bff/gapi/rpc_list_accounts.go index 1cc631c..f88eae9 100644 --- a/bff/gapi/rpc_list_accounts.go +++ b/bff/gapi/rpc_list_accounts.go @@ -34,7 +34,7 @@ func (server *Server) ListAccounts(ctx context.Context, req *pb.ListAccountsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no accounts found") } - slog.Error("list_accounts (db)", slog.String("invoked_by", authPayload.Email), slog.Int("page_id", int(req.GetPageId())), slog.Int("page_size", int(req.GetPageSize())), slog.String("error", err.Error())) + slog.Error("list_accounts (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int("page_id", int(req.GetPageId())), slog.Int("page_size", int(req.GetPageSize())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get accounts") } diff --git a/bff/gapi/rpc_list_payments.go b/bff/gapi/rpc_list_payments.go index aa1e48e..08a4651 100644 --- a/bff/gapi/rpc_list_payments.go +++ b/bff/gapi/rpc_list_payments.go @@ -23,16 +23,16 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("list_payments (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_payments (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -49,7 +49,7 @@ func (server *Server) ListPayments(ctx context.Context, req *pb.ListPaymentsRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no payments found") } - slog.Error("list_payments (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_payments (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get payments") } diff --git a/bff/gapi/rpc_list_persons.go b/bff/gapi/rpc_list_persons.go index 608c2fc..b37da0f 100644 --- a/bff/gapi/rpc_list_persons.go +++ b/bff/gapi/rpc_list_persons.go @@ -23,16 +23,16 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("list_persons (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_persons (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -49,7 +49,7 @@ func (server *Server) ListPersons(ctx context.Context, req *pb.ListPersonsReques if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no persons found") } - slog.Error("list_persons (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_persons (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get persons") } diff --git a/bff/gapi/rpc_list_returns_log_by_person_id.go b/bff/gapi/rpc_list_returns_log_by_person_id.go index 0e3d16d..4a8f8fd 100644 --- a/bff/gapi/rpc_list_returns_log_by_person_id.go +++ b/bff/gapi/rpc_list_returns_log_by_person_id.go @@ -23,16 +23,16 @@ func (server *Server) ListReturnsLog(ctx context.Context, req *pb.ListReturnsLog return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("list_returns_log_by_person_id (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) + slog.Error("list_returns_log_by_person_id (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -49,7 +49,7 @@ func (server *Server) ListReturnsLog(ctx context.Context, req *pb.ListReturnsLog if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no returns_logs found") } - slog.Error("list_returns_log_by_person_id (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) + slog.Error("list_returns_log_by_person_id (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetPersonId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get returns_logs") } diff --git a/bff/gapi/rpc_list_sessions.go b/bff/gapi/rpc_list_sessions.go index 7dadaa8..af721a9 100644 --- a/bff/gapi/rpc_list_sessions.go +++ b/bff/gapi/rpc_list_sessions.go @@ -23,16 +23,16 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("list_sessions (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_sessions (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -44,12 +44,12 @@ func (server *Server) ListSessions(ctx context.Context, req *pb.ListSessionsRequ } } - dbSessions, err := server.store.ListSessions(ctx, account.Email) + dbSessions, err := server.store.ListSessions(ctx, account.ID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "no accounts found") } - slog.Error("list_sessions (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) + slog.Error("list_sessions (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetAccountId())), slog.String("error", err.Error())) return nil, status.Error(codes.NotFound, "failed to get accounts") } diff --git a/bff/gapi/rpc_login.go b/bff/gapi/rpc_login.go index 4cdf108..ac7d9b3 100644 --- a/bff/gapi/rpc_login.go +++ b/bff/gapi/rpc_login.go @@ -44,7 +44,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi } refreshToken, refreshPayload, err := server.tokenMaker.CreateToken( - account.Email, + account.ID, id, server.config.RefreshTokenDuration, ) @@ -55,7 +55,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi } accessToken, accessPayload, err := server.tokenMaker.CreateToken( - account.Email, + account.ID, id, server.config.AccessTokenDuration, ) @@ -68,7 +68,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi _, err = server.store.CreateSession(ctx, db.CreateSessionParams{ ID: refreshPayload.ID, - Email: account.Email, + AccountID: account.ID, RefreshToken: refreshToken, UserAgent: mtdt.UserAgent, ClientIp: mtdt.ClientIP, @@ -87,7 +87,7 @@ func (server *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Logi AccessTokenExpiresAt: timestamppb.New(accessPayload.ExpiredAt), RefreshToken: refreshToken, RefreshTokenExpiresAt: timestamppb.New(refreshPayload.ExpiredAt), - Email: account.Email, + AccountId: account.ID, } return rsp, nil } diff --git a/bff/gapi/rpc_refresh_token.go b/bff/gapi/rpc_refresh_token.go index 8aa1f74..10d479f 100644 --- a/bff/gapi/rpc_refresh_token.go +++ b/bff/gapi/rpc_refresh_token.go @@ -32,7 +32,7 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Error(codes.NotFound, "session not found") } - slog.Error("refresh_token (get_account)", slog.String("invoked_by", refreshPayload.Email), slog.String("refresh_token", req.GetRefreshToken()), slog.String("error", err.Error())) + slog.Error("refresh_token (get_account)", slog.Int64("invoked_by", int64(refreshPayload.AccountID)), slog.String("refresh_token", req.GetRefreshToken()), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "cannot find session") } @@ -40,7 +40,7 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ return nil, status.Error(codes.PermissionDenied, "session is blocked") } - if session.Email != refreshPayload.Email { + if session.AccountID != refreshPayload.AccountID { return nil, status.Error(codes.PermissionDenied, "invalid account session") } @@ -56,16 +56,16 @@ func (server *Server) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequ id, err := server.tokenMaker.NewTokenID() if err != nil { - slog.Error("refresh_token (token_id)", slog.String("invoked_by", refreshPayload.Email), slog.String("error", err.Error())) + slog.Error("refresh_token (token_id)", slog.Int64("invoked_by", int64(refreshPayload.AccountID)), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create session token") } accessToken, accessPayload, err := server.tokenMaker.CreateToken( - refreshPayload.Email, + refreshPayload.AccountID, id, server.config.AccessTokenDuration, ) if err != nil { - slog.Error("refresh_token (access_token)", slog.String("invoked_by", refreshPayload.Email), slog.String("error", err.Error())) + slog.Error("refresh_token (access_token)", slog.Int64("invoked_by", int64(refreshPayload.AccountID)), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to create session token") } diff --git a/bff/gapi/rpc_update_account.go b/bff/gapi/rpc_update_account.go index 53cab57..0719a48 100644 --- a/bff/gapi/rpc_update_account.go +++ b/bff/gapi/rpc_update_account.go @@ -26,15 +26,20 @@ func (server *Server) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRe return nil, invalidArgumentError(violations) } - if authPayload.Email != req.GetEmail() { + if authPayload.AccountID != req.GetId() { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } } + account, err := server.store.GetAccount(ctx, req.GetId()) + if err != nil { + return nil, status.Error(codes.NotFound, "account not found") + } + arg := db.UpdateAccountTxParams{ ID: req.GetId(), - Changer: authPayload.Email, + Changer: account.Email, Email: sql.NullString{ Valid: req.GetEmail() != "", String: req.GetEmail(), @@ -76,7 +81,7 @@ func (server *Server) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRe if req.Password != nil { hashedPassword, err := util.HashPassword(req.GetPassword()) if err != nil { - slog.Error("update_account (hash_password)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_account (hash_password)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to hash password") } @@ -86,9 +91,9 @@ func (server *Server) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRe } } - account, err := server.store.UpdateAccountTx(ctx, arg) + account, err = server.store.UpdateAccountTx(ctx, arg) if err != nil { - slog.Error("update_account (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_account (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update account") } diff --git a/bff/gapi/rpc_update_account_privacy.go b/bff/gapi/rpc_update_account_privacy.go index 9df7a50..ded2ff1 100644 --- a/bff/gapi/rpc_update_account_privacy.go +++ b/bff/gapi/rpc_update_account_privacy.go @@ -29,11 +29,11 @@ func (server *Server) UpdateAccountPrivacy(ctx context.Context, req *pb.UpdateAc if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("update_account_privacy (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_account_privacy (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Errorf(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -41,14 +41,14 @@ func (server *Server) UpdateAccountPrivacy(ctx context.Context, req *pb.UpdateAc privacyAccepted := req.GetPrivacyAccepted() arg := db.UpdateAccountPrivacyTxParams{ - Changer: authPayload.Email, + Changer: account.Email, ID: req.GetId(), PrivacyAccepted: &privacyAccepted, } account, err = server.store.UpdateAccountPrivacyTx(ctx, arg) if err != nil { - slog.Error("update_account_privacy (db)", slog.String("invoked_by", authPayload.Email), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_account_privacy (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("account_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update account privacy") } diff --git a/bff/gapi/rpc_update_payment.go b/bff/gapi/rpc_update_payment.go index d151ab1..b5fcb71 100644 --- a/bff/gapi/rpc_update_payment.go +++ b/bff/gapi/rpc_update_payment.go @@ -25,16 +25,16 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("update_payment (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_payment (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -45,7 +45,7 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "payment not found") } - slog.Error("update_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_payment (get_payment)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get payment") } @@ -89,12 +89,12 @@ func (server *Server) UpdatePayment(ctx context.Context, req *pb.UpdatePaymentRe Valid: req.GetType() != "", String: req.GetType(), }, - Changer: authPayload.Email, + Changer: account.Email, } payment, err := server.store.UpdatePayment(ctx, arg) if err != nil { - slog.Error("update_payment (get_payment)", slog.String("invoked_by", authPayload.Email), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_payment (get_payment)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("payment_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update payment") } diff --git a/bff/gapi/rpc_update_person.go b/bff/gapi/rpc_update_person.go index 2177add..94626a0 100644 --- a/bff/gapi/rpc_update_person.go +++ b/bff/gapi/rpc_update_person.go @@ -24,16 +24,16 @@ func (server *Server) UpdatePerson(ctx context.Context, req *pb.UpdatePersonRequ return nil, invalidArgumentError(violations) } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "account not found") } - slog.Error("update_person (get_account)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_person (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get account") } - if authPayload.Email != account.Email { + if authPayload.AccountID != account.ID { if !server.isAdmin(ctx, authPayload) { return nil, status.Error(codes.NotFound, "account not found") } @@ -44,7 +44,7 @@ func (server *Server) UpdatePerson(ctx context.Context, req *pb.UpdatePersonRequ if errors.Is(err, sql.ErrNoRows) { return nil, status.Errorf(codes.NotFound, "person not found") } - slog.Error("update_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_person (get_person)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to get person") } @@ -84,12 +84,12 @@ func (server *Server) UpdatePerson(ctx context.Context, req *pb.UpdatePersonRequ Valid: req.GetBirthday().IsValid(), Time: req.GetBirthday().AsTime(), }, - Changer: authPayload.Email, + Changer: account.Email, } person, err := server.store.UpdatePerson(ctx, arg) if err != nil { - slog.Error("update_person (get_person)", slog.String("invoked_by", authPayload.Email), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) + slog.Error("update_person (get_person)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("person_id", int64(req.GetId())), slog.String("error", err.Error())) return nil, status.Error(codes.Internal, "failed to update person") } diff --git a/bff/gw/document.go b/bff/gw/document.go index 0b9697d..34f2b5c 100644 --- a/bff/gw/document.go +++ b/bff/gw/document.go @@ -34,7 +34,7 @@ func (server *Server) UploadDocument(ctx *gin.Context) { return } - account, err := server.store.GetAccountByEmail(ctx, authPayload.Email) + account, err := server.store.GetAccount(ctx, authPayload.AccountID) if err != nil { ctx.JSON(http.StatusNotFound, errorResponse(errors.New("account not found"))) return diff --git a/bff/pb/rpc_login.pb.go b/bff/pb/rpc_login.pb.go index 6d09e7a..8d2af0e 100644 --- a/bff/pb/rpc_login.pb.go +++ b/bff/pb/rpc_login.pb.go @@ -87,7 +87,7 @@ type LoginResponse struct { AccessTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` RefreshTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=refresh_token_expires_at,json=refreshTokenExpiresAt,proto3" json:"refresh_token_expires_at,omitempty"` - Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` + AccountId uint64 `protobuf:"varint,6,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } func (x *LoginResponse) Reset() { @@ -157,11 +157,11 @@ func (x *LoginResponse) GetRefreshTokenExpiresAt() *timestamppb.Timestamp { return nil } -func (x *LoginResponse) GetEmail() string { +func (x *LoginResponse) GetAccountId() uint64 { if x != nil { - return x.Email + return x.AccountId } - return "" + return 0 } var File_rpc_login_proto protoreflect.FileDescriptor @@ -173,93 +173,92 @@ var file_rpc_login_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, 0x20, 0x4a, 0x16, 0x22, 0x6a, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, - 0x6f, 0x6d, 0x22, 0xa2, 0x02, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x12, 0x43, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0x92, 0x41, 0x24, 0x4a, 0x17, 0x22, 0x4d, 0x61, 0x79, 0x54, - 0x68, 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x42, 0x65, 0x57, 0x69, 0x74, 0x68, 0x59, 0x6f, 0x75, - 0x21, 0x22, 0xa2, 0x02, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x3a, 0x79, 0x92, 0x41, 0x76, 0x0a, 0x2c, 0x2a, 0x05, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x32, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0xd2, - 0x01, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0x46, 0x7b, 0x22, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x22, 0x3a, 0x20, 0x22, 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x4d, 0x61, 0x79, 0x54, 0x68, - 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x42, 0x65, 0x57, 0x69, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x21, - 0x22, 0x7d, 0x22, 0xb6, 0x08, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x4a, 0x26, 0x22, - 0x35, 0x65, 0x31, 0x64, 0x36, 0x37, 0x64, 0x61, 0x2d, 0x37, 0x63, 0x39, 0x62, 0x2d, 0x34, 0x33, - 0x36, 0x35, 0x2d, 0x61, 0x34, 0x64, 0x35, 0x2d, 0x33, 0x63, 0x63, 0x30, 0x61, 0x30, 0x35, 0x31, - 0x32, 0x34, 0x31, 0x65, 0x22, 0xa2, 0x02, 0x04, 0x75, 0x75, 0x69, 0x64, 0x52, 0x09, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0xe9, 0x02, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xc5, - 0x02, 0x92, 0x41, 0xc1, 0x02, 0x4a, 0xbe, 0x02, 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2e, 0x65, 0x79, 0x4a, 0x6c, 0x62, 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, - 0x6d, 0x45, 0x79, 0x51, 0x47, 0x49, 0x75, 0x5a, 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, - 0x48, 0x41, 0x69, 0x4f, 0x69, 0x49, 0x79, 0x4d, 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, - 0x54, 0x41, 0x31, 0x56, 0x44, 0x41, 0x78, 0x4f, 0x6a, 0x45, 0x33, 0x4f, 0x6a, 0x41, 0x35, 0x4b, - 0x7a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x77, 0x49, 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, + 0x6f, 0x6d, 0x22, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x43, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0x92, 0x41, + 0x24, 0x4a, 0x17, 0x22, 0x4d, 0x61, 0x79, 0x54, 0x68, 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x42, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x21, 0x22, 0xa2, 0x02, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x3a, + 0x79, 0x92, 0x41, 0x76, 0x0a, 0x2c, 0x2a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x32, 0x10, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xd2, + 0x01, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0xd2, 0x01, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x32, 0x46, 0x7b, 0x22, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x3a, 0x20, 0x22, 0x6a, + 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, + 0x3a, 0x20, 0x22, 0x4d, 0x61, 0x79, 0x54, 0x68, 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x42, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x21, 0x22, 0x7d, 0x22, 0xa4, 0x08, 0x0a, 0x0d, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x32, 0x92, 0x41, 0x2f, 0x4a, 0x26, 0x22, 0x35, 0x65, 0x31, 0x64, 0x36, 0x37, 0x64, 0x61, + 0x2d, 0x37, 0x63, 0x39, 0x62, 0x2d, 0x34, 0x33, 0x36, 0x35, 0x2d, 0x61, 0x34, 0x64, 0x35, 0x2d, + 0x33, 0x63, 0x63, 0x30, 0x61, 0x30, 0x35, 0x31, 0x32, 0x34, 0x31, 0x65, 0x22, 0xa2, 0x02, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0xe9, 0x02, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xc5, 0x02, 0x92, 0x41, 0xc1, 0x02, 0x4a, 0xbe, 0x02, + 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x65, 0x79, 0x4a, 0x6c, 0x62, + 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, 0x6d, 0x45, 0x79, 0x51, 0x47, 0x49, 0x75, 0x5a, + 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, 0x48, 0x41, 0x69, 0x4f, 0x69, 0x49, 0x79, 0x4d, + 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, 0x54, 0x41, 0x31, 0x56, 0x44, 0x41, 0x78, 0x4f, + 0x6a, 0x45, 0x33, 0x4f, 0x6a, 0x41, 0x35, 0x4b, 0x7a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x77, 0x49, + 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, + 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, + 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x49, 0x73, 0x49, + 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x5a, 0x6a, 0x6c, 0x68, 0x4d, 0x6a, 0x45, 0x32, 0x4f, + 0x57, 0x51, 0x74, 0x4d, 0x57, 0x59, 0x78, 0x59, 0x53, 0x30, 0x30, 0x59, 0x54, 0x68, 0x69, 0x4c, + 0x54, 0x67, 0x7a, 0x5a, 0x57, 0x45, 0x74, 0x4e, 0x7a, 0x6b, 0x78, 0x4d, 0x7a, 0x59, 0x35, 0x59, + 0x6a, 0x59, 0x33, 0x5a, 0x6d, 0x59, 0x78, 0x49, 0x69, 0x77, 0x69, 0x62, 0x6d, 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x49, 0x73, 0x49, 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x5a, - 0x6a, 0x6c, 0x68, 0x4d, 0x6a, 0x45, 0x32, 0x4f, 0x57, 0x51, 0x74, 0x4d, 0x57, 0x59, 0x78, 0x59, - 0x53, 0x30, 0x30, 0x59, 0x54, 0x68, 0x69, 0x4c, 0x54, 0x67, 0x7a, 0x5a, 0x57, 0x45, 0x74, 0x4e, - 0x7a, 0x6b, 0x78, 0x4d, 0x7a, 0x59, 0x35, 0x59, 0x6a, 0x59, 0x33, 0x5a, 0x6d, 0x59, 0x78, 0x49, - 0x69, 0x77, 0x69, 0x62, 0x6d, 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, + 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x41, 0x68, 0x30, 0x62, 0x56, 0x62, 0x78, 0x39, 0x53, + 0x31, 0x4c, 0x52, 0x2d, 0x70, 0x66, 0x38, 0x68, 0x4c, 0x57, 0x56, 0x52, 0x51, 0x50, 0x55, 0x66, + 0x4b, 0x39, 0x7a, 0x72, 0x48, 0x5a, 0x76, 0x41, 0x37, 0x41, 0x70, 0x4a, 0x35, 0x61, 0x5a, 0x58, + 0x77, 0x68, 0x41, 0x37, 0x48, 0x31, 0x6a, 0x2d, 0x6b, 0x48, 0x68, 0x63, 0x63, 0x42, 0x6a, 0x4f, + 0x41, 0x47, 0x59, 0x58, 0x5a, 0x51, 0x54, 0x2d, 0x74, 0x73, 0x37, 0x4a, 0x71, 0x33, 0x53, 0x4a, + 0x6c, 0x7a, 0x6f, 0x35, 0x76, 0x74, 0x55, 0x6a, 0x47, 0x42, 0x74, 0x44, 0x67, 0x22, 0x52, 0x0b, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x51, 0x0a, 0x17, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0xeb, + 0x02, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0xc5, 0x02, 0x92, 0x41, 0xc1, 0x02, 0x4a, 0xbe, 0x02, + 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x65, 0x79, 0x4a, 0x6c, 0x62, + 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, 0x6d, 0x45, 0x79, 0x51, 0x47, 0x49, 0x75, 0x5a, + 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, 0x48, 0x41, 0x69, 0x4f, 0x69, 0x49, 0x79, 0x4d, + 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, 0x54, 0x41, 0x32, 0x56, 0x44, 0x41, 0x78, 0x4f, + 0x6a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x35, 0x4b, 0x7a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x77, 0x49, + 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x41, - 0x68, 0x30, 0x62, 0x56, 0x62, 0x78, 0x39, 0x53, 0x31, 0x4c, 0x52, 0x2d, 0x70, 0x66, 0x38, 0x68, - 0x4c, 0x57, 0x56, 0x52, 0x51, 0x50, 0x55, 0x66, 0x4b, 0x39, 0x7a, 0x72, 0x48, 0x5a, 0x76, 0x41, - 0x37, 0x41, 0x70, 0x4a, 0x35, 0x61, 0x5a, 0x58, 0x77, 0x68, 0x41, 0x37, 0x48, 0x31, 0x6a, 0x2d, - 0x6b, 0x48, 0x68, 0x63, 0x63, 0x42, 0x6a, 0x4f, 0x41, 0x47, 0x59, 0x58, 0x5a, 0x51, 0x54, 0x2d, - 0x74, 0x73, 0x37, 0x4a, 0x71, 0x33, 0x53, 0x4a, 0x6c, 0x7a, 0x6f, 0x35, 0x76, 0x74, 0x55, 0x6a, - 0x47, 0x42, 0x74, 0x44, 0x67, 0x22, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x51, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0xeb, 0x02, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0xc5, - 0x02, 0x92, 0x41, 0xc1, 0x02, 0x4a, 0xbe, 0x02, 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2e, 0x65, 0x79, 0x4a, 0x6c, 0x62, 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, - 0x6d, 0x45, 0x79, 0x51, 0x47, 0x49, 0x75, 0x5a, 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, - 0x48, 0x41, 0x69, 0x4f, 0x69, 0x49, 0x79, 0x4d, 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, - 0x54, 0x41, 0x32, 0x56, 0x44, 0x41, 0x78, 0x4f, 0x6a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x35, 0x4b, - 0x7a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x77, 0x49, 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, + 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x49, 0x73, 0x49, + 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x4e, 0x57, 0x55, 0x78, 0x5a, 0x44, 0x59, 0x33, 0x5a, + 0x47, 0x45, 0x74, 0x4e, 0x32, 0x4d, 0x35, 0x59, 0x69, 0x30, 0x30, 0x4d, 0x7a, 0x59, 0x31, 0x4c, + 0x57, 0x45, 0x30, 0x5a, 0x44, 0x55, 0x74, 0x4d, 0x32, 0x4e, 0x6a, 0x4d, 0x47, 0x45, 0x77, 0x4e, + 0x54, 0x45, 0x79, 0x4e, 0x44, 0x46, 0x6c, 0x49, 0x69, 0x77, 0x69, 0x62, 0x6d, 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x49, 0x73, 0x49, 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x4e, - 0x57, 0x55, 0x78, 0x5a, 0x44, 0x59, 0x33, 0x5a, 0x47, 0x45, 0x74, 0x4e, 0x32, 0x4d, 0x35, 0x59, - 0x69, 0x30, 0x30, 0x4d, 0x7a, 0x59, 0x31, 0x4c, 0x57, 0x45, 0x30, 0x5a, 0x44, 0x55, 0x74, 0x4d, - 0x32, 0x4e, 0x6a, 0x4d, 0x47, 0x45, 0x77, 0x4e, 0x54, 0x45, 0x79, 0x4e, 0x44, 0x46, 0x6c, 0x49, - 0x69, 0x77, 0x69, 0x62, 0x6d, 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, - 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x42, - 0x6f, 0x58, 0x33, 0x36, 0x77, 0x30, 0x70, 0x6f, 0x31, 0x76, 0x76, 0x48, 0x53, 0x6a, 0x73, 0x42, - 0x50, 0x5f, 0x4b, 0x57, 0x65, 0x46, 0x78, 0x56, 0x31, 0x78, 0x52, 0x62, 0x51, 0x61, 0x79, 0x71, - 0x62, 0x4a, 0x75, 0x49, 0x6f, 0x4b, 0x32, 0x6a, 0x4b, 0x71, 0x79, 0x31, 0x42, 0x74, 0x32, 0x52, - 0x6f, 0x48, 0x79, 0x4a, 0x62, 0x4c, 0x6f, 0x43, 0x45, 0x4f, 0x31, 0x35, 0x43, 0x52, 0x54, 0x35, - 0x44, 0x6e, 0x51, 0x36, 0x50, 0x30, 0x41, 0x48, 0x6c, 0x42, 0x7a, 0x6a, 0x73, 0x58, 0x74, 0x36, - 0x31, 0x61, 0x44, 0x44, 0x77, 0x22, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x53, 0x0a, 0x18, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x15, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, 0x20, 0x4a, 0x16, 0x22, - 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0xa2, 0x02, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x15, 0x92, 0x41, 0x12, 0x0a, 0x10, 0x2a, 0x0e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, - 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x42, 0x6f, 0x58, 0x33, 0x36, 0x77, 0x30, 0x70, 0x6f, + 0x31, 0x76, 0x76, 0x48, 0x53, 0x6a, 0x73, 0x42, 0x50, 0x5f, 0x4b, 0x57, 0x65, 0x46, 0x78, 0x56, + 0x31, 0x78, 0x52, 0x62, 0x51, 0x61, 0x79, 0x71, 0x62, 0x4a, 0x75, 0x49, 0x6f, 0x4b, 0x32, 0x6a, + 0x4b, 0x71, 0x79, 0x31, 0x42, 0x74, 0x32, 0x52, 0x6f, 0x48, 0x79, 0x4a, 0x62, 0x4c, 0x6f, 0x43, + 0x45, 0x4f, 0x31, 0x35, 0x43, 0x52, 0x54, 0x35, 0x44, 0x6e, 0x51, 0x36, 0x50, 0x30, 0x41, 0x48, + 0x6c, 0x42, 0x7a, 0x6a, 0x73, 0x58, 0x74, 0x36, 0x31, 0x61, 0x44, 0x44, 0x77, 0x22, 0x52, 0x0c, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x53, 0x0a, 0x18, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x15, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, + 0x74, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x08, 0x92, 0x41, 0x05, 0x4a, 0x03, 0x22, 0x31, 0x22, 0x52, + 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x15, 0x92, 0x41, 0x12, 0x0a, + 0x10, 0x2a, 0x0e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/session.pb.go b/bff/pb/session.pb.go index c98d165..4ff4572 100644 --- a/bff/pb/session.pb.go +++ b/bff/pb/session.pb.go @@ -28,7 +28,7 @@ type Session struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` UserAgent string `protobuf:"bytes,3,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` ClientIp string `protobuf:"bytes,4,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` IsBlocked bool `protobuf:"varint,5,opt,name=is_blocked,json=isBlocked,proto3" json:"is_blocked,omitempty"` @@ -76,11 +76,11 @@ func (x *Session) GetId() string { return "" } -func (x *Session) GetEmail() string { +func (x *Session) GetAccountId() uint64 { if x != nil { - return x.Email + return x.AccountId } - return "" + return 0 } func (x *Session) GetUserAgent() string { @@ -134,66 +134,66 @@ var file_session_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x07, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x07, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x49, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x12, 0x56, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, - 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x09, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, - 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, - 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0xab, 0x04, 0x92, 0x41, 0xa7, 0x04, 0x0a, 0x09, 0x2a, - 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x99, 0x04, 0x7b, 0x22, 0x69, 0x64, 0x22, - 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x22, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x3a, 0x20, 0x22, - 0x6a, 0x6f, 0x68, 0x6e, 0x2e, 0x64, 0x6f, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2e, 0x65, 0x79, 0x4a, 0x6c, 0x62, 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, - 0x6d, 0x45, 0x79, 0x51, 0x47, 0x49, 0x75, 0x5a, 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, - 0x48, 0x41, 0x69, 0x4f, 0x69, 0x49, 0x79, 0x4d, 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, - 0x54, 0x41, 0x32, 0x56, 0x44, 0x41, 0x78, 0x4f, 0x6a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x35, 0x4b, - 0x7a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x77, 0x49, 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, - 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, - 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x49, 0x73, 0x49, 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x4e, - 0x57, 0x55, 0x78, 0x5a, 0x44, 0x59, 0x33, 0x5a, 0x47, 0x45, 0x74, 0x4e, 0x32, 0x4d, 0x35, 0x59, - 0x69, 0x30, 0x30, 0x4d, 0x7a, 0x59, 0x31, 0x4c, 0x57, 0x45, 0x30, 0x5a, 0x44, 0x55, 0x74, 0x4d, - 0x32, 0x4e, 0x6a, 0x4d, 0x47, 0x45, 0x77, 0x4e, 0x54, 0x45, 0x79, 0x4e, 0x44, 0x46, 0x6c, 0x49, - 0x69, 0x77, 0x69, 0x62, 0x6d, 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, - 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, - 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x42, - 0x6f, 0x58, 0x33, 0x36, 0x77, 0x30, 0x70, 0x6f, 0x31, 0x76, 0x76, 0x48, 0x53, 0x6a, 0x73, 0x42, - 0x50, 0x5f, 0x4b, 0x57, 0x65, 0x46, 0x78, 0x56, 0x31, 0x78, 0x52, 0x62, 0x51, 0x61, 0x79, 0x71, - 0x62, 0x4a, 0x75, 0x49, 0x6f, 0x4b, 0x32, 0x6a, 0x4b, 0x71, 0x79, 0x31, 0x42, 0x74, 0x32, 0x52, - 0x6f, 0x48, 0x79, 0x4a, 0x62, 0x4c, 0x6f, 0x43, 0x45, 0x4f, 0x31, 0x35, 0x43, 0x52, 0x54, 0x35, - 0x44, 0x6e, 0x51, 0x36, 0x50, 0x30, 0x41, 0x48, 0x6c, 0x42, 0x7a, 0x6a, 0x73, 0x58, 0x74, 0x36, - 0x31, 0x61, 0x44, 0x44, 0x77, 0x22, 0x2c, 0x20, 0x22, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, - 0x5f, 0x61, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, - 0x35, 0x54, 0x30, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x35, 0x33, 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, - 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x3a, 0x31, 0x31, - 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x22, 0x3a, - 0x20, 0x22, 0x31, 0x30, 0x2e, 0x35, 0x36, 0x2e, 0x30, 0x2e, 0x31, 0x32, 0x22, 0x2c, 0x20, 0x22, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x4d, 0x6f, - 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x46, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x78, 0x22, 0x2c, 0x20, - 0x22, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x7d, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x69, + 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, + 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, + 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x41, 0x74, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x1b, 0x92, 0x41, 0x18, 0x4a, 0x16, 0x22, 0x31, 0x39, 0x39, 0x30, 0x2d, 0x31, + 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x22, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, + 0x9d, 0x04, 0x92, 0x41, 0x99, 0x04, 0x0a, 0x09, 0x2a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x32, 0x8b, 0x04, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x22, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, + 0x2c, 0x20, 0x22, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x3a, 0x20, 0x22, 0x76, 0x34, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x65, 0x79, + 0x4a, 0x6c, 0x62, 0x57, 0x46, 0x70, 0x62, 0x43, 0x49, 0x36, 0x49, 0x6d, 0x45, 0x79, 0x51, 0x47, + 0x49, 0x75, 0x5a, 0x47, 0x55, 0x69, 0x4c, 0x43, 0x4a, 0x6c, 0x65, 0x48, 0x41, 0x69, 0x4f, 0x69, + 0x49, 0x79, 0x4d, 0x44, 0x49, 0x7a, 0x4c, 0x54, 0x45, 0x77, 0x4c, 0x54, 0x41, 0x32, 0x56, 0x44, + 0x41, 0x78, 0x4f, 0x6a, 0x41, 0x79, 0x4f, 0x6a, 0x41, 0x35, 0x4b, 0x7a, 0x41, 0x79, 0x4f, 0x6a, + 0x41, 0x77, 0x49, 0x69, 0x77, 0x69, 0x61, 0x57, 0x46, 0x30, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, + 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, + 0x6f, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4f, 0x53, 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, + 0x49, 0x73, 0x49, 0x6d, 0x6c, 0x6b, 0x49, 0x6a, 0x6f, 0x69, 0x4e, 0x57, 0x55, 0x78, 0x5a, 0x44, + 0x59, 0x33, 0x5a, 0x47, 0x45, 0x74, 0x4e, 0x32, 0x4d, 0x35, 0x59, 0x69, 0x30, 0x30, 0x4d, 0x7a, + 0x59, 0x31, 0x4c, 0x57, 0x45, 0x30, 0x5a, 0x44, 0x55, 0x74, 0x4d, 0x32, 0x4e, 0x6a, 0x4d, 0x47, + 0x45, 0x77, 0x4e, 0x54, 0x45, 0x79, 0x4e, 0x44, 0x46, 0x6c, 0x49, 0x69, 0x77, 0x69, 0x62, 0x6d, + 0x4a, 0x6d, 0x49, 0x6a, 0x6f, 0x69, 0x4d, 0x6a, 0x41, 0x79, 0x4d, 0x79, 0x30, 0x78, 0x4d, 0x43, + 0x30, 0x77, 0x4e, 0x56, 0x51, 0x77, 0x4d, 0x54, 0x6f, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4f, 0x53, + 0x73, 0x77, 0x4d, 0x6a, 0x6f, 0x77, 0x4d, 0x43, 0x4a, 0x39, 0x42, 0x6f, 0x58, 0x33, 0x36, 0x77, + 0x30, 0x70, 0x6f, 0x31, 0x76, 0x76, 0x48, 0x53, 0x6a, 0x73, 0x42, 0x50, 0x5f, 0x4b, 0x57, 0x65, + 0x46, 0x78, 0x56, 0x31, 0x78, 0x52, 0x62, 0x51, 0x61, 0x79, 0x71, 0x62, 0x4a, 0x75, 0x49, 0x6f, + 0x4b, 0x32, 0x6a, 0x4b, 0x71, 0x79, 0x31, 0x42, 0x74, 0x32, 0x52, 0x6f, 0x48, 0x79, 0x4a, 0x62, + 0x4c, 0x6f, 0x43, 0x45, 0x4f, 0x31, 0x35, 0x43, 0x52, 0x54, 0x35, 0x44, 0x6e, 0x51, 0x36, 0x50, + 0x30, 0x41, 0x48, 0x6c, 0x42, 0x7a, 0x6a, 0x73, 0x58, 0x74, 0x36, 0x31, 0x61, 0x44, 0x44, 0x77, + 0x22, 0x2c, 0x20, 0x22, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x22, 0x3a, + 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x54, 0x30, 0x32, 0x3a, + 0x33, 0x30, 0x3a, 0x35, 0x33, 0x5a, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x30, 0x2d, + 0x30, 0x35, 0x54, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x3a, 0x31, 0x31, 0x5a, 0x22, 0x2c, 0x20, 0x22, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x30, 0x2e, + 0x35, 0x36, 0x2e, 0x30, 0x2e, 0x31, 0x32, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, + 0x20, 0x46, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x78, 0x22, 0x2c, 0x20, 0x22, 0x69, 0x73, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x7d, 0x42, + 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, + 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/bff/proto/rpc_login.proto b/bff/proto/rpc_login.proto index 644fa10..ed1b63a 100644 --- a/bff/proto/rpc_login.proto +++ b/bff/proto/rpc_login.proto @@ -20,7 +20,6 @@ message LoginRequest { example: "{\"email\": \"john.doe@example.com\", \"password\": \"MayTheForceBeWithYou!\"}"; }; string email = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - format: "email", example: "\"john.doe@example.com\"" }]; string password = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { @@ -47,8 +46,7 @@ message LoginResponse { example: "\"v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw\"" }]; google.protobuf.Timestamp refresh_token_expires_at = 5; - string email = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - format: "email", - example: "\"john.doe@example.com\"" + uint64 account_id = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + example: "\"1\"" }]; } \ No newline at end of file diff --git a/bff/proto/session.proto b/bff/proto/session.proto index 0a46af6..22e29c0 100644 --- a/bff/proto/session.proto +++ b/bff/proto/session.proto @@ -12,10 +12,10 @@ message Session { json_schema: { title: "Session"; }; - example: "{\"id\": \"1\",\"email\": \"john.doe@example.com\", \"refresh_token\": \"v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw\", \"expires_at\": \"2023-10-05T02:30:53Z\", \"created_at\": \"2023-10-05T01:20:11Z\", \"client_ip\": \"10.56.0.12\", \"user_agent\": \"Mozilla Firefox\", \"is_blocked\": false}"; + example: "{\"id\": \"1\",\"account_id\": \"1\", \"refresh_token\": \"v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw\", \"expires_at\": \"2023-10-05T02:30:53Z\", \"created_at\": \"2023-10-05T01:20:11Z\", \"client_ip\": \"10.56.0.12\", \"user_agent\": \"Mozilla Firefox\", \"is_blocked\": false}"; }; string id = 1; - string email = 2; + uint64 account_id = 2; string user_agent = 3; string client_ip = 4; bool is_blocked = 5; diff --git a/bff/sqlc.yaml b/bff/sqlc.yaml index 9fcc26c..4116e20 100644 --- a/bff/sqlc.yaml +++ b/bff/sqlc.yaml @@ -29,6 +29,8 @@ sql: go_type: "uint64" - column: "returns.person_id" go_type: "uint64" + - column: "sessions.account_id" + go_type: "uint64" - db_type: "timestamptz" go_type: "time.Time" - db_type: "uuid" diff --git a/bff/token/maker.go b/bff/token/maker.go index 3598bb4..ad291d7 100644 --- a/bff/token/maker.go +++ b/bff/token/maker.go @@ -10,7 +10,7 @@ import ( type Maker interface { NewTokenID() (uuid.UUID, error) // CreateToken creates a new token for a specific username and duration - CreateToken(email string, id uuid.UUID, duration time.Duration) (string, *Payload, error) + CreateToken(account_id uint64, id uuid.UUID, duration time.Duration) (string, *Payload, error) // VerifyToken checks if the token is valid or not VerifyToken(token string) (*Payload, error) diff --git a/bff/token/paseto_maker.go b/bff/token/paseto_maker.go index eaf1aa2..7366bcb 100644 --- a/bff/token/paseto_maker.go +++ b/bff/token/paseto_maker.go @@ -1,6 +1,8 @@ package token import ( + "fmt" + "strconv" "time" "aidanwoods.dev/go-paseto" @@ -35,8 +37,8 @@ func (maker *PasetoMaker) NewTokenID() (uuid.UUID, error) { } // CreateToken creates a new token for a specific username and duration -func (maker *PasetoMaker) CreateToken(email string, id uuid.UUID, duration time.Duration) (string, *Payload, error) { - payload, err := NewPayload(email, id, duration) +func (maker *PasetoMaker) CreateToken(account_id uint64, id uuid.UUID, duration time.Duration) (string, *Payload, error) { + payload, err := NewPayload(account_id, id, duration) if err != nil { return "", payload, err } @@ -46,7 +48,7 @@ func (maker *PasetoMaker) CreateToken(email string, id uuid.UUID, duration time. token.SetIssuedAt(payload.IssuedAt) token.SetExpiration(payload.ExpiredAt) token.SetString("id", id.String()) - token.SetString("email", payload.Email) + token.SetString("account_id", fmt.Sprintf("%d", payload.AccountID)) signed := token.V4Sign(maker.privateKey, nil) return signed, payload, err @@ -71,7 +73,12 @@ func (maker *PasetoMaker) VerifyToken(token string) (*Payload, error) { return nil, ErrInvalidToken } - payload.Email, err = t.GetString("email") + account_id, err := t.GetString("account_id") + if err != nil { + return nil, ErrInvalidToken + } + + payload.AccountID, err = strconv.ParseUint(account_id, 10, 64) if err != nil { return nil, ErrInvalidToken } diff --git a/bff/token/paseto_maker_test.go b/bff/token/paseto_maker_test.go index cbd9e48..95adb74 100644 --- a/bff/token/paseto_maker_test.go +++ b/bff/token/paseto_maker_test.go @@ -12,7 +12,7 @@ func TestPasetoMaker(t *testing.T) { maker, err := NewPasetoMaker(devPrivateKeyHex) require.NoError(t, err) - email := util.RandomEmail() + account_id := util.RandomInt(100, 10000) duration := time.Minute * 2 issuedAt := time.Now() @@ -20,7 +20,7 @@ func TestPasetoMaker(t *testing.T) { id, err := maker.NewTokenID() require.NoError(t, err) - token, payload, err := maker.CreateToken(email, id, duration) + token, payload, err := maker.CreateToken(account_id, id, duration) require.NoError(t, err) require.NotEmpty(t, token) require.NotEmpty(t, payload) @@ -30,7 +30,7 @@ func TestPasetoMaker(t *testing.T) { require.NotEmpty(t, token) require.NotZero(t, payload.ID) - require.Equal(t, email, payload.Email) + require.Equal(t, account_id, payload.AccountID) require.WithinDuration(t, issuedAt, payload.IssuedAt, time.Second) require.WithinDuration(t, expiredAt, payload.ExpiredAt, time.Second) } @@ -41,7 +41,7 @@ func TestExpiredPasetoToken(t *testing.T) { id, err := maker.NewTokenID() require.NoError(t, err) - token, payload, err := maker.CreateToken(util.RandomEmail(), id, -time.Minute) + token, payload, err := maker.CreateToken(util.RandomInt(100, 10000), id, -time.Minute) require.NoError(t, err) require.NotEmpty(t, token) require.NotEmpty(t, payload) diff --git a/bff/token/payload.go b/bff/token/payload.go index 4f84373..21aba71 100644 --- a/bff/token/payload.go +++ b/bff/token/payload.go @@ -16,16 +16,16 @@ var ( // Payload contains the payload data of the token type Payload struct { ID uuid.UUID `json:"id"` - Email string `json:"account_id"` + AccountID uint64 `json:"account_id"` IssuedAt time.Time `json:"issued_at"` ExpiredAt time.Time `json:"expired_at"` } // NewPayload creates a new token payload with a specific accountID and duration -func NewPayload(email string, tokenID uuid.UUID, duration time.Duration) (*Payload, error) { +func NewPayload(account_id uint64, tokenID uuid.UUID, duration time.Duration) (*Payload, error) { payload := &Payload{ ID: tokenID, - Email: email, + AccountID: account_id, IssuedAt: time.Now(), ExpiredAt: time.Now().Add(duration), } From 37df328e0cc8fd335aab06d8837f54ffe593f82b Mon Sep 17 00:00:00 2001 From: itsscb Date: Sun, 15 Oct 2023 07:52:40 +0200 Subject: [PATCH 14/15] rf/file upload via form and with metadata --- bff/doc/swagger/df.swagger.json | 3 +- bff/gw/document.go | 100 ++++++++++++++++++++-------- bff/pb/rpc_upload_document.pb.go | 39 +++++------ bff/pb/service_df.pb.go | 45 +++++++------ bff/proto/rpc_upload_document.proto | 2 +- bff/proto/service_df.proto | 2 +- 6 files changed, 118 insertions(+), 73 deletions(-) diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index e8e8896..2da7011 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -29,7 +29,7 @@ "/documents/upload": { "post": { "summary": "Upload Document [only HTTP]", - "description": "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" \"http://{serverURI}/documents/upload\"```", + "description": "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" -F \"person_id=1\" \"http://{serverURI}/documents/upload\"```", "operationId": "df_UploadDocument", "responses": { "200": { @@ -1870,7 +1870,6 @@ "pbUploadDocumentRequest": { "type": "object", "example": { - "file": "10101010101010010100101010010101", "person_id": "1" }, "properties": { diff --git a/bff/gw/document.go b/bff/gw/document.go index 34f2b5c..2b13ec4 100644 --- a/bff/gw/document.go +++ b/bff/gw/document.go @@ -3,18 +3,23 @@ package gw import ( "errors" "fmt" + "io" + "mime/multipart" "net/http" "os" + "path" "path/filepath" "strings" "github.com/gin-gonic/gin" + "github.com/google/uuid" ) -// type uploadDocumentRequest struct { -// PersonID uint64 `json:"person_id"` -// MailID uint64 `json:"mail_id"` -// } +type uploadDocumentRequest struct { + PersonID uint64 `form:"person_id"` + MailID uint64 `form:"mail_id"` + File *multipart.FileHeader `form:"file"` +} func (server *Server) UploadDocument(ctx *gin.Context) { authHeader := ctx.GetHeader("authorization") @@ -40,10 +45,6 @@ func (server *Server) UploadDocument(ctx *gin.Context) { return } - // TODO: FileUpload with POST-Values - // bodyData, _ := io.ReadAll(ctx.Request.Body) - // slog.Info("Document", slog.String("body", fmt.Sprintf("%#v", string(bodyData)))) - file, err := ctx.FormFile("file") if err != nil { ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not parse file"))) @@ -52,32 +53,79 @@ func (server *Server) UploadDocument(ctx *gin.Context) { targetDir := filepath.Join("./files", fmt.Sprintf("%d", account.ID)) - // var req *uploadDocumentRequest - // _ = ctx.ShouldBindJSON(&req) + var req *uploadDocumentRequest + err = ctx.ShouldBind(&req) + if err != nil { + ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("failed to parse request"))) + return + } - // if req != nil { - // if req.MailID <= 0 && req.PersonID <= 0 { - // ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("document can't be assigned to both person_id AND mail_id"))) - // return - // } + fileData, err := file.Open() + if err != nil { + ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("failed to read file"))) + return + } - // if req.MailID > 0 { - // targetDir = filepath.Join(targetDir, "mail", fmt.Sprintf("%d", req.MailID)) - // } - // if req.PersonID > 0 { - // targetDir = filepath.Join(targetDir, "person", fmt.Sprintf("%d", req.PersonID)) - // } - // } + if req != nil { + if req.MailID <= 0 && req.PersonID <= 0 { + ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("document can't be assigned to both person_id AND mail_id"))) + return + } - p := filepath.Join(targetDir, file.Filename) + if req.MailID > 0 { + _, err := server.store.GetMail(ctx, req.MailID) + if err != nil { + ctx.JSON(http.StatusNotFound, errorResponse(errors.New("mail not found"))) + return + + } + targetDir = filepath.Join(targetDir, "mail", fmt.Sprintf("%d", req.MailID)) + } + if req.PersonID > 0 { + _, err := server.store.GetPerson(ctx, req.PersonID) + if err != nil { + ctx.JSON(http.StatusNotFound, errorResponse(errors.New("person not found"))) + return + + } + targetDir = filepath.Join(targetDir, "person", fmt.Sprintf("%d", req.PersonID)) + } + } + + uid, err := uuid.NewUUID() + if err != nil { + ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not generate file name"))) + return + } + + if _, err := os.Stat(targetDir); err != nil { + err = os.MkdirAll(targetDir, 0755) + if err != nil { + ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not create directory structure"))) + return + } + + } + + p := filepath.Join(targetDir, uid.String()+path.Ext(file.Filename)) if _, err := os.Stat(p); err != nil { - err = ctx.SaveUploadedFile(file, p) + f, err := os.Create(p) if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not save file"))) + ctx.JSON(http.StatusInternalServerError, errorResponse(fmt.Errorf("could not create file: %v", err))) return - } + + _, err = io.Copy(f, fileData) + if err != nil { + ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not write file"))) + return + } + // err = ctx.SaveUploadedFile(file, p) + // if err != nil { + // ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not save file"))) + // return + // } } else { ctx.JSON(http.StatusConflict, errorResponse(errors.New("filename already exists"))) return diff --git a/bff/pb/rpc_upload_document.pb.go b/bff/pb/rpc_upload_document.pb.go index 654a21a..3295630 100644 --- a/bff/pb/rpc_upload_document.pb.go +++ b/bff/pb/rpc_upload_document.pb.go @@ -140,32 +140,29 @@ var file_rpc_upload_document_proto_rawDesc = []byte{ 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x91, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0xe3, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x07, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x48, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x3a, 0x89, 0x01, - 0x92, 0x41, 0x85, 0x01, 0x0a, 0x42, 0x2a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, - 0x50, 0x5d, 0x32, 0x1d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x61, 0x20, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, - 0x5d, 0xd2, 0x01, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x32, 0x3f, 0x7b, 0x22, 0x66, 0x69, 0x6c, 0x65, - 0x22, 0x3a, 0x20, 0x22, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, - 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x31, - 0x30, 0x31, 0x30, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x61, 0x69, 0x6c, - 0x5f, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, - 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, 0x2a, 0x17, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x48, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x3a, 0x5c, 0x92, + 0x41, 0x59, 0x0a, 0x42, 0x2a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, + 0x32, 0x1d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x61, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, 0xd2, + 0x01, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x32, 0x13, 0x7b, 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x20, 0x7d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x61, + 0x69, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, + 0x2a, 0x17, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, + 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index 95e0f84..7aca2d0 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -64,7 +64,7 @@ var file_service_df_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0xbd, 0x19, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6f, 0x32, 0xce, 0x19, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, @@ -247,14 +247,14 @@ var file_service_df_proto_rawDesc = []byte{ 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, - 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xb9, 0x02, 0x0a, + 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xca, 0x02, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xef, 0x01, 0x92, 0x41, 0xcf, 0x01, 0x12, 0x1b, 0x55, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x02, 0x92, 0x41, 0xe0, 0x01, 0x12, 0x1b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, - 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, 0x1a, 0x9d, 0x01, 0x54, 0x65, 0x73, + 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, 0x1a, 0xae, 0x01, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x69, 0x61, 0x20, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x54, 0x72, 0x79, 0x20, 0x60, 0x60, 0x60, 0x63, 0x75, 0x72, 0x6c, 0x20, 0x2d, 0x58, @@ -262,24 +262,25 @@ var file_service_df_proto_rawDesc = []byte{ 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x3d, 0x40, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, - 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x55, 0x52, 0x49, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x60, 0x60, 0x60, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, - 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, - 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, - 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, - 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, - 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x3d, + 0x31, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x55, 0x52, 0x49, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x60, 0x60, 0x60, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, + 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, + 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, + 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, + 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, + 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ diff --git a/bff/proto/rpc_upload_document.proto b/bff/proto/rpc_upload_document.proto index 07059c1..76da119 100644 --- a/bff/proto/rpc_upload_document.proto +++ b/bff/proto/rpc_upload_document.proto @@ -17,7 +17,7 @@ message UploadDocumentRequest { "file" ]; }; - example: "{\"file\": \"10101010101010010100101010010101\", \"person_id\": \"1\" }"; + example: "{\"person_id\": \"1\" }"; }; bytes file = 1; optional uint64 person_id = 2; diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index c18f68b..47133ae 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -340,7 +340,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Upload Document [only HTTP]" - description: "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" \"http://{serverURI}/documents/upload\"```" + description: "Testing via swagger is not possible. Try ```curl -X POST -H \"Authorization: Bearer {token}\" -F \"file=@/path/to/file\" -F \"person_id=1\" \"http://{serverURI}/documents/upload\"```" security: { security_requirement: { key: "BearerAuth"; From 0875bc480103a1df59899216199ef95ac996dbbf Mon Sep 17 00:00:00 2001 From: itsscb Date: Sun, 15 Oct 2023 22:23:53 +0200 Subject: [PATCH 15/15] ft/adds tx & endpoint for create & delete document --- bff/db/migration/000001_init_schema.up.sql | 2 +- bff/db/mock/store.go | 77 +++ bff/db/query/document.sql | 40 +- bff/db/sqlc/account.sql.go | 2 +- bff/db/sqlc/db.go | 2 +- bff/db/sqlc/document.sql.go | 180 ++++++- bff/db/sqlc/document_test.go | 10 +- bff/db/sqlc/mail.sql.go | 2 +- bff/db/sqlc/models.go | 4 +- bff/db/sqlc/payment.sql.go | 2 +- bff/db/sqlc/person.sql.go | 2 +- bff/db/sqlc/provider.sql.go | 2 +- bff/db/sqlc/querier.go | 5 +- bff/db/sqlc/return.sql.go | 2 +- bff/db/sqlc/returnsLog.sql.go | 2 +- bff/db/sqlc/session.sql.go | 2 +- bff/db/sqlc/store.go | 4 + bff/db/sqlc/tx_create_document.go | 139 ++++++ bff/db/sqlc/tx_delete_document.go | 46 ++ bff/doc/swagger/df.swagger.json | 54 +++ bff/gapi/rpc_delete_document.go | 79 +++ bff/gw/document.go | 97 +--- bff/pb/rpc_delete_document.pb.go | 227 +++++++++ bff/pb/service_df.pb.go | 529 +++++++++++---------- bff/pb/service_df.pb.gw.go | 103 ++++ bff/pb/service_df_grpc.pb.go | 37 ++ bff/proto/rpc_delete_document.proto | 32 ++ bff/proto/service_df.proto | 15 + 28 files changed, 1317 insertions(+), 381 deletions(-) create mode 100644 bff/db/sqlc/tx_create_document.go create mode 100644 bff/db/sqlc/tx_delete_document.go create mode 100644 bff/gapi/rpc_delete_document.go create mode 100644 bff/pb/rpc_delete_document.pb.go create mode 100644 bff/proto/rpc_delete_document.proto diff --git a/bff/db/migration/000001_init_schema.up.sql b/bff/db/migration/000001_init_schema.up.sql index 42fcb62..1a21371 100644 --- a/bff/db/migration/000001_init_schema.up.sql +++ b/bff/db/migration/000001_init_schema.up.sql @@ -66,7 +66,7 @@ CREATE TABLE "documents" ( "name" varchar NOT NULL, "type" varchar NOT NULL, "path" varchar NOT NULL, - "url" varchar NOT NULL, + "hash" varchar NOT NULL, "valid" boolean NOT NULL DEFAULT false, "valid_date" timestamptz, "validated_by" varchar, diff --git a/bff/db/mock/store.go b/bff/db/mock/store.go index b51b579..bd8e1b8 100644 --- a/bff/db/mock/store.go +++ b/bff/db/mock/store.go @@ -16,6 +16,7 @@ import ( uuid "github.com/google/uuid" db "github.com/itsscb/df/bff/db/sqlc" gomock "go.uber.org/mock/gomock" + codes "google.golang.org/grpc/codes" ) // MockStore is a mock of Store interface. @@ -99,6 +100,21 @@ func (mr *MockStoreMockRecorder) CreateAccountTx(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccountTx", reflect.TypeOf((*MockStore)(nil).CreateAccountTx), arg0, arg1) } +// CreateDocument mocks base method. +func (m *MockStore) CreateDocument(arg0 context.Context, arg1 db.CreateDocumentParams) (db.Document, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateDocument", arg0, arg1) + ret0, _ := ret[0].(db.Document) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateDocument indicates an expected call of CreateDocument. +func (mr *MockStoreMockRecorder) CreateDocument(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDocument", reflect.TypeOf((*MockStore)(nil).CreateDocument), arg0, arg1) +} + // CreateDocumentMail mocks base method. func (m *MockStore) CreateDocumentMail(arg0 context.Context, arg1 db.CreateDocumentMailParams) (db.Document, error) { m.ctrl.T.Helper() @@ -114,6 +130,22 @@ func (mr *MockStoreMockRecorder) CreateDocumentMail(arg0, arg1 any) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDocumentMail", reflect.TypeOf((*MockStore)(nil).CreateDocumentMail), arg0, arg1) } +// CreateDocumentTx mocks base method. +func (m *MockStore) CreateDocumentTx(arg0 context.Context, arg1 db.CreateDocumentTxParams) (db.Document, int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateDocumentTx", arg0, arg1) + ret0, _ := ret[0].(db.Document) + ret1, _ := ret[1].(int) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CreateDocumentTx indicates an expected call of CreateDocumentTx. +func (mr *MockStoreMockRecorder) CreateDocumentTx(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDocumentTx", reflect.TypeOf((*MockStore)(nil).CreateDocumentTx), arg0, arg1) +} + // CreateDocumentUpload mocks base method. func (m *MockStore) CreateDocumentUpload(arg0 context.Context, arg1 db.CreateDocumentUploadParams) (db.Document, error) { m.ctrl.T.Helper() @@ -277,6 +309,21 @@ func (mr *MockStoreMockRecorder) DeleteDocument(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDocument", reflect.TypeOf((*MockStore)(nil).DeleteDocument), arg0, arg1) } +// DeleteDocumentTx mocks base method. +func (m *MockStore) DeleteDocumentTx(arg0 context.Context, arg1 uint64) (codes.Code, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteDocumentTx", arg0, arg1) + ret0, _ := ret[0].(codes.Code) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteDocumentTx indicates an expected call of DeleteDocumentTx. +func (mr *MockStoreMockRecorder) DeleteDocumentTx(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDocumentTx", reflect.TypeOf((*MockStore)(nil).DeleteDocumentTx), arg0, arg1) +} + // DeleteDocumentsByPersonID mocks base method. func (m *MockStore) DeleteDocumentsByPersonID(arg0 context.Context, arg1 sql.NullInt64) error { m.ctrl.T.Helper() @@ -477,6 +524,36 @@ func (mr *MockStoreMockRecorder) GetDocument(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDocument", reflect.TypeOf((*MockStore)(nil).GetDocument), arg0, arg1) } +// GetDocumentByHash mocks base method. +func (m *MockStore) GetDocumentByHash(arg0 context.Context, arg1 db.GetDocumentByHashParams) ([]uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDocumentByHash", arg0, arg1) + ret0, _ := ret[0].([]uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDocumentByHash indicates an expected call of GetDocumentByHash. +func (mr *MockStoreMockRecorder) GetDocumentByHash(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDocumentByHash", reflect.TypeOf((*MockStore)(nil).GetDocumentByHash), arg0, arg1) +} + +// GetDocumentByIDWithAccountID mocks base method. +func (m *MockStore) GetDocumentByIDWithAccountID(arg0 context.Context, arg1 db.GetDocumentByIDWithAccountIDParams) (db.Document, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDocumentByIDWithAccountID", arg0, arg1) + ret0, _ := ret[0].(db.Document) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDocumentByIDWithAccountID indicates an expected call of GetDocumentByIDWithAccountID. +func (mr *MockStoreMockRecorder) GetDocumentByIDWithAccountID(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDocumentByIDWithAccountID", reflect.TypeOf((*MockStore)(nil).GetDocumentByIDWithAccountID), arg0, arg1) +} + // GetMail mocks base method. func (m *MockStore) GetMail(arg0 context.Context, arg1 uint64) (db.Mail, error) { m.ctrl.T.Helper() diff --git a/bff/db/query/document.sql b/bff/db/query/document.sql index 7a0941d..79ee8f1 100644 --- a/bff/db/query/document.sql +++ b/bff/db/query/document.sql @@ -2,13 +2,47 @@ SELECT * FROM documents WHERE "id" = $1 LIMIT 1; +-- name: GetDocumentByHash :many +SELECT d."id" FROM documents d +INNER JOIN persons p + ON d."person_id" = p."id" +WHERE p."account_id" = sqlc.arg(account_id) AND + d."hash" = sqlc.arg(hash); + +-- name: GetDocumentByIDWithAccountID :one +SELECT d.* FROM documents d +INNER JOIN persons p + ON d."person_id" = p."id" +WHERE d."id" = sqlc.arg(id) AND p."account_id" = sqlc.arg(account_id); + +-- name: CreateDocument :one +INSERT INTO documents ( + "person_id", + "name", + "type", + "path", + "hash", + "creator", + "changer", + "mail_id" +) VALUES ( + sqlc.narg(person_id), + sqlc.arg(name), + sqlc.arg(type), + sqlc.arg(path), + sqlc.arg(hash), + sqlc.arg(creator), + sqlc.arg(creator), + sqlc.narg(mail_id) +) RETURNING *; + -- name: CreateDocumentUpload :one INSERT INTO documents ( "person_id", "name", "type", "path", - "url", + "hash", "creator", "changer", "mail_id" @@ -22,7 +56,7 @@ INSERT INTO documents ( "name", "type", "path", - "url", + "hash", "creator", "changer", "person_id" @@ -42,7 +76,7 @@ SET "name" = COALESCE(sqlc.narg(name), "name"), "type" = COALESCE(sqlc.narg(type), "type"), "path" = COALESCE(sqlc.narg(path), "path"), - "url" = COALESCE(sqlc.narg(url), "url"), + "hash" = COALESCE(sqlc.narg(hash), "hash"), changer = $2, changed = now() WHERE "id" = $1 diff --git a/bff/db/sqlc/account.sql.go b/bff/db/sqlc/account.sql.go index c5e1d0d..779da37 100644 --- a/bff/db/sqlc/account.sql.go +++ b/bff/db/sqlc/account.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: account.sql package db diff --git a/bff/db/sqlc/db.go b/bff/db/sqlc/db.go index 46fda54..3d2b5bf 100644 --- a/bff/db/sqlc/db.go +++ b/bff/db/sqlc/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 package db diff --git a/bff/db/sqlc/document.sql.go b/bff/db/sqlc/document.sql.go index b7258c0..8911e23 100644 --- a/bff/db/sqlc/document.sql.go +++ b/bff/db/sqlc/document.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: document.sql package db @@ -10,19 +10,81 @@ import ( "database/sql" ) +const createDocument = `-- name: CreateDocument :one +INSERT INTO documents ( + "person_id", + "name", + "type", + "path", + "hash", + "creator", + "changer", + "mail_id" +) VALUES ( + $1, + $2, + $3, + $4, + $5, + $6, + $6, + $7 +) RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +` + +type CreateDocumentParams struct { + PersonID sql.NullInt64 `json:"person_id"` + Name string `json:"name"` + Type string `json:"type"` + Path string `json:"path"` + Hash string `json:"hash"` + Creator string `json:"creator"` + MailID sql.NullInt64 `json:"mail_id"` +} + +func (q *Queries) CreateDocument(ctx context.Context, arg CreateDocumentParams) (Document, error) { + row := q.db.QueryRowContext(ctx, createDocument, + arg.PersonID, + arg.Name, + arg.Type, + arg.Path, + arg.Hash, + arg.Creator, + arg.MailID, + ) + var i Document + err := row.Scan( + &i.ID, + &i.PersonID, + &i.Name, + &i.Type, + &i.Path, + &i.Hash, + &i.Valid, + &i.ValidDate, + &i.ValidatedBy, + &i.MailID, + &i.Creator, + &i.Created, + &i.Changer, + &i.Changed, + ) + return i, err +} + const createDocumentMail = `-- name: CreateDocumentMail :one INSERT INTO documents ( "mail_id", "name", "type", "path", - "url", + "hash", "creator", "changer", "person_id" ) VALUES ( $1, $2, $3, $4, $5, $6, $7, NULL -) RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +) RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` type CreateDocumentMailParams struct { @@ -30,7 +92,7 @@ type CreateDocumentMailParams struct { Name string `json:"name"` Type string `json:"type"` Path string `json:"path"` - Url string `json:"url"` + Hash string `json:"hash"` Creator string `json:"creator"` Changer string `json:"changer"` } @@ -41,7 +103,7 @@ func (q *Queries) CreateDocumentMail(ctx context.Context, arg CreateDocumentMail arg.Name, arg.Type, arg.Path, - arg.Url, + arg.Hash, arg.Creator, arg.Changer, ) @@ -52,7 +114,7 @@ func (q *Queries) CreateDocumentMail(ctx context.Context, arg CreateDocumentMail &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -71,13 +133,13 @@ INSERT INTO documents ( "name", "type", "path", - "url", + "hash", "creator", "changer", "mail_id" ) VALUES ( $1, $2, $3, $4, $5, $6, $7, NULL -) RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +) RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` type CreateDocumentUploadParams struct { @@ -85,7 +147,7 @@ type CreateDocumentUploadParams struct { Name string `json:"name"` Type string `json:"type"` Path string `json:"path"` - Url string `json:"url"` + Hash string `json:"hash"` Creator string `json:"creator"` Changer string `json:"changer"` } @@ -96,7 +158,7 @@ func (q *Queries) CreateDocumentUpload(ctx context.Context, arg CreateDocumentUp arg.Name, arg.Type, arg.Path, - arg.Url, + arg.Hash, arg.Creator, arg.Changer, ) @@ -107,7 +169,7 @@ func (q *Queries) CreateDocumentUpload(ctx context.Context, arg CreateDocumentUp &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -141,7 +203,7 @@ func (q *Queries) DeleteDocumentsByPersonID(ctx context.Context, personID sql.Nu } const getDocument = `-- name: GetDocument :one -SELECT id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed FROM documents +SELECT id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed FROM documents WHERE "id" = $1 LIMIT 1 ` @@ -154,7 +216,77 @@ func (q *Queries) GetDocument(ctx context.Context, id uint64) (Document, error) &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, + &i.Valid, + &i.ValidDate, + &i.ValidatedBy, + &i.MailID, + &i.Creator, + &i.Created, + &i.Changer, + &i.Changed, + ) + return i, err +} + +const getDocumentByHash = `-- name: GetDocumentByHash :many +SELECT d."id" FROM documents d +INNER JOIN persons p + ON d."person_id" = p."id" +WHERE p."account_id" = $1 AND + d."hash" = $2 +` + +type GetDocumentByHashParams struct { + AccountID uint64 `json:"account_id"` + Hash string `json:"hash"` +} + +func (q *Queries) GetDocumentByHash(ctx context.Context, arg GetDocumentByHashParams) ([]uint64, error) { + rows, err := q.db.QueryContext(ctx, getDocumentByHash, arg.AccountID, arg.Hash) + if err != nil { + return nil, err + } + defer rows.Close() + items := []uint64{} + for rows.Next() { + var id uint64 + if err := rows.Scan(&id); err != nil { + return nil, err + } + items = append(items, id) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getDocumentByIDWithAccountID = `-- name: GetDocumentByIDWithAccountID :one +SELECT d.id, d.person_id, d.name, d.type, d.path, d.hash, d.valid, d.valid_date, d.validated_by, d.mail_id, d.creator, d.created, d.changer, d.changed FROM documents d +INNER JOIN persons p + ON d."person_id" = p."id" +WHERE d."id" = $1 AND p."account_id" = $2 +` + +type GetDocumentByIDWithAccountIDParams struct { + ID uint64 `json:"id"` + AccountID uint64 `json:"account_id"` +} + +func (q *Queries) GetDocumentByIDWithAccountID(ctx context.Context, arg GetDocumentByIDWithAccountIDParams) (Document, error) { + row := q.db.QueryRowContext(ctx, getDocumentByIDWithAccountID, arg.ID, arg.AccountID) + var i Document + err := row.Scan( + &i.ID, + &i.PersonID, + &i.Name, + &i.Type, + &i.Path, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -176,7 +308,7 @@ SET "changer" = $2, "changed" = now() WHERE "id" = $1 -RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` type InvalidateDocumentParams struct { @@ -193,7 +325,7 @@ func (q *Queries) InvalidateDocument(ctx context.Context, arg InvalidateDocument &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -207,7 +339,7 @@ func (q *Queries) InvalidateDocument(ctx context.Context, arg InvalidateDocument } const listDocuments = `-- name: ListDocuments :many -SELECT id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed FROM documents +SELECT id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed FROM documents ORDER BY "valid", "type", "name" LIMIT $1 OFFSET $2 @@ -233,7 +365,7 @@ func (q *Queries) ListDocuments(ctx context.Context, arg ListDocumentsParams) ([ &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -262,11 +394,11 @@ SET "name" = COALESCE($3, "name"), "type" = COALESCE($4, "type"), "path" = COALESCE($5, "path"), - "url" = COALESCE($6, "url"), + "hash" = COALESCE($6, "hash"), changer = $2, changed = now() WHERE "id" = $1 -RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` type UpdateDocumentParams struct { @@ -275,7 +407,7 @@ type UpdateDocumentParams struct { Name sql.NullString `json:"name"` Type sql.NullString `json:"type"` Path sql.NullString `json:"path"` - Url sql.NullString `json:"url"` + Hash sql.NullString `json:"hash"` } func (q *Queries) UpdateDocument(ctx context.Context, arg UpdateDocumentParams) (Document, error) { @@ -285,7 +417,7 @@ func (q *Queries) UpdateDocument(ctx context.Context, arg UpdateDocumentParams) arg.Name, arg.Type, arg.Path, - arg.Url, + arg.Hash, ) var i Document err := row.Scan( @@ -294,7 +426,7 @@ func (q *Queries) UpdateDocument(ctx context.Context, arg UpdateDocumentParams) &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, @@ -316,7 +448,7 @@ SET "changer" = $2, "changed" = now() WHERE "id" = $1 -RETURNING id, person_id, name, type, path, url, valid, valid_date, validated_by, mail_id, creator, created, changer, changed +RETURNING id, person_id, name, type, path, hash, valid, valid_date, validated_by, mail_id, creator, created, changer, changed ` type ValidateDocumentParams struct { @@ -333,7 +465,7 @@ func (q *Queries) ValidateDocument(ctx context.Context, arg ValidateDocumentPara &i.Name, &i.Type, &i.Path, - &i.Url, + &i.Hash, &i.Valid, &i.ValidDate, &i.ValidatedBy, diff --git a/bff/db/sqlc/document_test.go b/bff/db/sqlc/document_test.go index 95e05cf..359c6eb 100644 --- a/bff/db/sqlc/document_test.go +++ b/bff/db/sqlc/document_test.go @@ -24,7 +24,7 @@ func createRandomDocumentUpload(t *testing.T) Document { Name: util.RandomString(20), Type: util.RandomString(5), Path: util.RandomString(50), - Url: util.RandomString(60), + Hash: util.RandomString(60), Creator: creator, Changer: creator, } @@ -37,7 +37,7 @@ func createRandomDocumentUpload(t *testing.T) Document { require.Equal(t, arg.Name, document.Name) require.Equal(t, arg.Type, document.Type) require.Equal(t, arg.Path, document.Path) - require.Equal(t, arg.Url, document.Url) + require.Equal(t, arg.Hash, document.Hash) require.Equal(t, arg.Creator, document.Creator) require.Equal(t, arg.Changer, document.Changer) require.Equal(t, document.Valid, false) @@ -62,7 +62,7 @@ func TestCreateDocumentMail(t *testing.T) { Name: util.RandomString(20), Type: util.RandomString(5), Path: util.RandomString(50), - Url: util.RandomString(60), + Hash: util.RandomString(60), Creator: util.RandomName(), Changer: util.RandomName(), } @@ -75,7 +75,7 @@ func TestCreateDocumentMail(t *testing.T) { require.Equal(t, arg.Name, document.Name) require.Equal(t, arg.Type, document.Type) require.Equal(t, arg.Path, document.Path) - require.Equal(t, arg.Url, document.Url) + require.Equal(t, arg.Hash, document.Hash) require.Equal(t, arg.Creator, document.Creator) require.Equal(t, arg.Changer, document.Changer) require.Equal(t, document.Valid, false) @@ -102,7 +102,7 @@ func TestGetDocument(t *testing.T) { require.Equal(t, newdocument.ID, document.ID) require.Equal(t, newdocument.PersonID, document.PersonID) require.Equal(t, newdocument.Type, document.Type) - require.Equal(t, newdocument.Url, document.Url) + require.Equal(t, newdocument.Hash, document.Hash) require.Equal(t, newdocument.Path, document.Path) require.Equal(t, newdocument.Valid, document.Valid) require.Equal(t, newdocument.ValidDate, document.ValidDate) diff --git a/bff/db/sqlc/mail.sql.go b/bff/db/sqlc/mail.sql.go index 9c947a3..b770e48 100644 --- a/bff/db/sqlc/mail.sql.go +++ b/bff/db/sqlc/mail.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: mail.sql package db diff --git a/bff/db/sqlc/models.go b/bff/db/sqlc/models.go index 592e2d2..20920aa 100644 --- a/bff/db/sqlc/models.go +++ b/bff/db/sqlc/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 package db @@ -38,7 +38,7 @@ type Document struct { Name string `json:"name"` Type string `json:"type"` Path string `json:"path"` - Url string `json:"url"` + Hash string `json:"hash"` Valid bool `json:"valid"` ValidDate sql.NullTime `json:"valid_date"` ValidatedBy sql.NullString `json:"validated_by"` diff --git a/bff/db/sqlc/payment.sql.go b/bff/db/sqlc/payment.sql.go index 795bdf2..4b1ee17 100644 --- a/bff/db/sqlc/payment.sql.go +++ b/bff/db/sqlc/payment.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: payment.sql package db diff --git a/bff/db/sqlc/person.sql.go b/bff/db/sqlc/person.sql.go index 6c5bbfd..8eb9693 100644 --- a/bff/db/sqlc/person.sql.go +++ b/bff/db/sqlc/person.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: person.sql package db diff --git a/bff/db/sqlc/provider.sql.go b/bff/db/sqlc/provider.sql.go index 15ca6cf..cbc92a8 100644 --- a/bff/db/sqlc/provider.sql.go +++ b/bff/db/sqlc/provider.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: provider.sql package db diff --git a/bff/db/sqlc/querier.go b/bff/db/sqlc/querier.go index 16d23ae..0c8fb83 100644 --- a/bff/db/sqlc/querier.go +++ b/bff/db/sqlc/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 package db @@ -15,6 +15,7 @@ type Querier interface { BlockSession(ctx context.Context, id uuid.UUID) error CloneProviders(ctx context.Context, arg CloneProvidersParams) error CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error) + CreateDocument(ctx context.Context, arg CreateDocumentParams) (Document, error) CreateDocumentMail(ctx context.Context, arg CreateDocumentMailParams) (Document, error) CreateDocumentUpload(ctx context.Context, arg CreateDocumentUploadParams) (Document, error) CreateMail(ctx context.Context, arg CreateMailParams) (Mail, error) @@ -52,6 +53,8 @@ type Querier interface { GetAccountByEmail(ctx context.Context, email string) (Account, error) GetAccountForUpdate(ctx context.Context, id uint64) (Account, error) GetDocument(ctx context.Context, id uint64) (Document, error) + GetDocumentByHash(ctx context.Context, arg GetDocumentByHashParams) ([]uint64, error) + GetDocumentByIDWithAccountID(ctx context.Context, arg GetDocumentByIDWithAccountIDParams) (Document, error) GetMail(ctx context.Context, id uint64) (Mail, error) GetPayment(ctx context.Context, id uint64) (Payment, error) GetPerson(ctx context.Context, id uint64) (Person, error) diff --git a/bff/db/sqlc/return.sql.go b/bff/db/sqlc/return.sql.go index 3969183..a784141 100644 --- a/bff/db/sqlc/return.sql.go +++ b/bff/db/sqlc/return.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: return.sql package db diff --git a/bff/db/sqlc/returnsLog.sql.go b/bff/db/sqlc/returnsLog.sql.go index 96ccd60..b7e31c9 100644 --- a/bff/db/sqlc/returnsLog.sql.go +++ b/bff/db/sqlc/returnsLog.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: returnsLog.sql package db diff --git a/bff/db/sqlc/session.sql.go b/bff/db/sqlc/session.sql.go index 86da596..4550092 100644 --- a/bff/db/sqlc/session.sql.go +++ b/bff/db/sqlc/session.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.21.0 +// sqlc v1.22.0 // source: session.sql package db diff --git a/bff/db/sqlc/store.go b/bff/db/sqlc/store.go index cf1849a..d2cb8a9 100644 --- a/bff/db/sqlc/store.go +++ b/bff/db/sqlc/store.go @@ -4,6 +4,8 @@ import ( "context" "database/sql" "fmt" + + "google.golang.org/grpc/codes" ) type Store interface { @@ -13,6 +15,8 @@ type Store interface { UpdateAccountPrivacyTx(ctx context.Context, arg UpdateAccountPrivacyTxParams) (Account, error) CreatePersonTx(ctx context.Context, arg CreatePersonTxParams) (Person, error) DeletePersonTx(ctx context.Context, id uint64) error + CreateDocumentTx(ctx context.Context, arg CreateDocumentTxParams) (doc Document, code int, err error) + DeleteDocumentTx(ctx context.Context, id uint64) (code codes.Code, err error) } // Store provides all functions to execute db queries and transactions diff --git a/bff/db/sqlc/tx_create_document.go b/bff/db/sqlc/tx_create_document.go new file mode 100644 index 0000000..6665ce4 --- /dev/null +++ b/bff/db/sqlc/tx_create_document.go @@ -0,0 +1,139 @@ +package db + +import ( + "context" + "crypto/sha256" + "database/sql" + "encoding/hex" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "os" + "path" + "path/filepath" +) + +type CreateDocumentTxParams struct { + AccountID uint64 `json:"account_id"` + PersonID uint64 `json:"person_id"` + MailID uint64 `json:"mail_id"` + File *multipart.FileHeader `json:"file"` + Creator string `json:"creator"` +} + +type CreateDocumentTxResult struct { + Document Document `json:"document"` +} + +func (store *SQLStore) CreateDocumentTx(ctx context.Context, arg CreateDocumentTxParams) (doc Document, code int, err error) { + var result CreateDocumentTxResult + + if arg.MailID > 0 && arg.PersonID > 0 { + return Document{}, http.StatusBadRequest, errors.New("document can't be assigned to both person_id AND mail_id") + } + if arg.MailID < 1 && arg.PersonID < 1 { + return Document{}, http.StatusBadRequest, errors.New("document has to be assigned to either a person_id or a mail_id") + } + + req := CreateDocumentParams{ + Creator: arg.Creator, + } + targetDir := filepath.Join("./files", fmt.Sprintf("%d", arg.AccountID)) + + fileData, err := arg.File.Open() + if err != nil { + return Document{}, http.StatusBadRequest, errors.New("failed to read file") + } + + h := sha256.New() + _, err = io.Copy(h, fileData) + if err != nil { + return Document{}, http.StatusInternalServerError, errors.New("could not create file hash") + } + + fileData.Seek(0, io.SeekStart) + + req.Hash = hex.EncodeToString(h.Sum(nil)) + + if arg.MailID > 0 { + _, err := store.GetMail(ctx, arg.MailID) + if err != nil { + return Document{}, http.StatusNotFound, errors.New("mail not found") + } + + targetDir = filepath.Join(targetDir, "mail", fmt.Sprintf("%d", arg.MailID)) + + req.MailID = sql.NullInt64{ + Valid: true, + Int64: int64(arg.MailID), + } + } + + if arg.PersonID > 0 { + _, err := store.GetPerson(ctx, arg.PersonID) + if err != nil { + return Document{}, http.StatusNotFound, errors.New("person not found") + } + + docs, err := store.GetDocumentByHash(ctx, GetDocumentByHashParams{ + AccountID: arg.AccountID, + Hash: req.Hash, + }) + if err != nil { + return Document{}, http.StatusInternalServerError, fmt.Errorf("could not check file hash in db: %v", err.Error()) + } + + if len(docs) > 0 { + return Document{ + ID: docs[0], + }, http.StatusConflict, errors.New("file already exists in database") + } + + targetDir = filepath.Join(targetDir, "person", fmt.Sprintf("%d", arg.PersonID)) + req.PersonID = sql.NullInt64{ + Valid: true, + Int64: int64(arg.PersonID), + } + } + + req.Type = path.Ext(arg.File.Filename) + req.Name = arg.File.Filename + + p := filepath.Join(targetDir, req.Hash+path.Ext(arg.File.Filename)) + req.Path = p + + if _, err := os.Stat(p); err == nil { + return Document{}, http.StatusConflict, errors.New("file already exists") + } + + err = store.execTx(ctx, func(q *Queries) error { + var err error + + if _, err := os.Stat(targetDir); err != nil { + err = os.MkdirAll(targetDir, 0755) + if err != nil { + return errors.New("could not create directory structure") + } + + } + f, err := os.Create(p) + if err != nil { + return fmt.Errorf("could not create file: %v", err) + } + + _, err = io.Copy(f, fileData) + if err != nil { + return errors.New("could not write file") + } + + result.Document, err = q.CreateDocument(ctx, req) + if err != nil { + return err + } + return err + }) + + return result.Document, http.StatusInternalServerError, err +} diff --git a/bff/db/sqlc/tx_delete_document.go b/bff/db/sqlc/tx_delete_document.go new file mode 100644 index 0000000..13b6282 --- /dev/null +++ b/bff/db/sqlc/tx_delete_document.go @@ -0,0 +1,46 @@ +package db + +import ( + "context" + "fmt" + "os" + "path/filepath" + + "google.golang.org/grpc/codes" +) + +func (store *SQLStore) DeleteDocumentTx(ctx context.Context, id uint64) (code codes.Code, err error) { + + doc, err := store.GetDocument(ctx, id) + if err != nil { + return codes.NotFound, fmt.Errorf("document not found") + } + + p := filepath.Join("./", doc.Path) + + _, err = os.Stat(p) + if err != nil { + return codes.Internal, fmt.Errorf("document not found on disk") + } + + err = store.execTx(ctx, func(q *Queries) error { + var err error + + err = q.DeleteDocument(ctx, id) + if err != nil { + return err + } + + err = os.Remove(p) + if err != nil { + return fmt.Errorf("could not delete file from disk") + } + return err + }) + + if err != nil { + return codes.Internal, err + } + + return codes.OK, err +} diff --git a/bff/doc/swagger/df.swagger.json b/bff/doc/swagger/df.swagger.json index 2da7011..d774dc5 100644 --- a/bff/doc/swagger/df.swagger.json +++ b/bff/doc/swagger/df.swagger.json @@ -259,6 +259,43 @@ ] } }, + "/v1/documents/delete_document/{id}": { + "delete": { + "summary": "Delete Document by ID", + "operationId": "df_DeleteDocument", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteDocumentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "format": "uint64" + } + ], + "tags": [ + "df" + ], + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/v1/login": { "post": { "operationId": "df_Login", @@ -1138,6 +1175,23 @@ "description": "Returns the created Person", "title": "Created Person" }, + "pbDeleteDocumentResponse": { + "type": "object", + "example": { + "id": "1", + "deleted": true + }, + "properties": { + "id": { + "type": "string", + "format": "uint64" + }, + "deleted": { + "type": "boolean" + } + }, + "title": "Delete Document Response" + }, "pbDeletePaymentResponse": { "type": "object", "example": { diff --git a/bff/gapi/rpc_delete_document.go b/bff/gapi/rpc_delete_document.go new file mode 100644 index 0000000..142a500 --- /dev/null +++ b/bff/gapi/rpc_delete_document.go @@ -0,0 +1,79 @@ +package gapi + +import ( + "context" + "database/sql" + "errors" + "log/slog" + + db "github.com/itsscb/df/bff/db/sqlc" + "github.com/itsscb/df/bff/pb" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteDocument(ctx context.Context, req *pb.DeleteDocumentRequest) (*pb.DeleteDocumentResponse, error) { + authPayload, err := server.authorizeUser(ctx) + if err != nil { + return nil, unauthenticatedError(err) + } + + violations := validateDeleteDocumentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + account, err := server.store.GetAccount(ctx, authPayload.AccountID) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "account not found") + } + slog.Error("delete_document (get_account)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("document_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, "failed to get account") + } + + if authPayload.AccountID != account.ID { + if !server.isAdmin(ctx, authPayload) { + return nil, status.Error(codes.NotFound, "account not found") + } + } + + var document db.Document + + if !server.isAdmin(ctx, authPayload) { + document, err = server.store.GetDocumentByIDWithAccountID(ctx, db.GetDocumentByIDWithAccountIDParams{ + ID: req.GetId(), + AccountID: account.ID, + }) + } else { + document, err = server.store.GetDocument(ctx, req.GetId()) + } + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, status.Errorf(codes.NotFound, "document not found") + } + slog.Error("delete_document (get_document)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("document_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Errorf(codes.Internal, "failed to get document") + } + + code, err := server.store.DeleteDocumentTx(ctx, document.ID) + if err != nil { + slog.Error("delete_document (db)", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.Int64("document_id", int64(req.GetId())), slog.String("error", err.Error())) + return nil, status.Errorf(code, "failed to delete document") + } + + rsp := &pb.DeleteDocumentResponse{ + Id: document.ID, + Deleted: true, + } + return rsp, nil +} + +func validateDeleteDocumentRequest(req *pb.DeleteDocumentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetId() < 1 { + violations = append(violations, fieldViolation("id", errors.New("must be greater than 0"))) + } + + return violations +} diff --git a/bff/gw/document.go b/bff/gw/document.go index 2b13ec4..a78af36 100644 --- a/bff/gw/document.go +++ b/bff/gw/document.go @@ -2,17 +2,14 @@ package gw import ( "errors" - "fmt" - "io" "mime/multipart" "net/http" - "os" - "path" - "path/filepath" "strings" + "log/slog" + "github.com/gin-gonic/gin" - "github.com/google/uuid" + db "github.com/itsscb/df/bff/db/sqlc" ) type uploadDocumentRequest struct { @@ -45,14 +42,6 @@ func (server *Server) UploadDocument(ctx *gin.Context) { return } - file, err := ctx.FormFile("file") - if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not parse file"))) - return - } - - targetDir := filepath.Join("./files", fmt.Sprintf("%d", account.ID)) - var req *uploadDocumentRequest err = ctx.ShouldBind(&req) if err != nil { @@ -60,74 +49,22 @@ func (server *Server) UploadDocument(ctx *gin.Context) { return } - fileData, err := file.Open() + r := db.CreateDocumentTxParams{ + AccountID: account.ID, + PersonID: req.PersonID, + MailID: req.MailID, + File: req.File, + Creator: account.Email, + } + + doc, code, err := server.store.CreateDocumentTx(ctx, r) if err != nil { - ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("failed to read file"))) + if code == http.StatusInternalServerError { + slog.Error("create_document", slog.Int64("invoked_by", int64(authPayload.AccountID)), slog.String("document_name", req.File.Filename), slog.String("error", err.Error())) + } + ctx.JSON(code, errorResponse(err)) return } - if req != nil { - if req.MailID <= 0 && req.PersonID <= 0 { - ctx.JSON(http.StatusBadRequest, errorResponse(errors.New("document can't be assigned to both person_id AND mail_id"))) - return - } - - if req.MailID > 0 { - _, err := server.store.GetMail(ctx, req.MailID) - if err != nil { - ctx.JSON(http.StatusNotFound, errorResponse(errors.New("mail not found"))) - return - - } - targetDir = filepath.Join(targetDir, "mail", fmt.Sprintf("%d", req.MailID)) - } - if req.PersonID > 0 { - _, err := server.store.GetPerson(ctx, req.PersonID) - if err != nil { - ctx.JSON(http.StatusNotFound, errorResponse(errors.New("person not found"))) - return - - } - targetDir = filepath.Join(targetDir, "person", fmt.Sprintf("%d", req.PersonID)) - } - } - - uid, err := uuid.NewUUID() - if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not generate file name"))) - return - } - - if _, err := os.Stat(targetDir); err != nil { - err = os.MkdirAll(targetDir, 0755) - if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not create directory structure"))) - return - } - - } - - p := filepath.Join(targetDir, uid.String()+path.Ext(file.Filename)) - - if _, err := os.Stat(p); err != nil { - f, err := os.Create(p) - if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(fmt.Errorf("could not create file: %v", err))) - return - } - - _, err = io.Copy(f, fileData) - if err != nil { - ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not write file"))) - return - } - // err = ctx.SaveUploadedFile(file, p) - // if err != nil { - // ctx.JSON(http.StatusInternalServerError, errorResponse(errors.New("could not save file"))) - // return - // } - } else { - ctx.JSON(http.StatusConflict, errorResponse(errors.New("filename already exists"))) - return - } + ctx.JSON(http.StatusOK, doc) } diff --git a/bff/pb/rpc_delete_document.pb.go b/bff/pb/rpc_delete_document.pb.go new file mode 100644 index 0000000..3d13cfe --- /dev/null +++ b/bff/pb/rpc_delete_document.pb.go @@ -0,0 +1,227 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: rpc_delete_document.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DeleteDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteDocumentRequest) Reset() { + *x = DeleteDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_document_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDocumentRequest) ProtoMessage() {} + +func (x *DeleteDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_document_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDocumentRequest.ProtoReflect.Descriptor instead. +func (*DeleteDocumentRequest) Descriptor() ([]byte, []int) { + return file_rpc_delete_document_proto_rawDescGZIP(), []int{0} +} + +func (x *DeleteDocumentRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteDocumentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` +} + +func (x *DeleteDocumentResponse) Reset() { + *x = DeleteDocumentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_delete_document_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDocumentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDocumentResponse) ProtoMessage() {} + +func (x *DeleteDocumentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_delete_document_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDocumentResponse.ProtoReflect.Descriptor instead. +func (*DeleteDocumentResponse) Descriptor() ([]byte, []int) { + return file_rpc_delete_document_proto_rawDescGZIP(), []int{1} +} + +func (x *DeleteDocumentResponse) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DeleteDocumentResponse) GetDeleted() bool { + if x != nil { + return x.Deleted + } + return false +} + +var File_rpc_delete_document_proto protoreflect.FileDescriptor + +var file_rpc_delete_document_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x64, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x3b, 0x92, 0x41, 0x38, 0x0a, 0x29, 0x2a, + 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x32, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x02, 0x69, 0x64, 0x32, 0x0b, 0x7b, 0x22, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x31, 0x22, 0x7d, 0x22, 0x81, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x3a, 0x3d, 0x92, 0x41, 0x3a, 0x0a, + 0x1a, 0x2a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x20, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x1c, 0x7b, 0x22, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x42, 0x19, 0x5a, 0x17, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, + 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_delete_document_proto_rawDescOnce sync.Once + file_rpc_delete_document_proto_rawDescData = file_rpc_delete_document_proto_rawDesc +) + +func file_rpc_delete_document_proto_rawDescGZIP() []byte { + file_rpc_delete_document_proto_rawDescOnce.Do(func() { + file_rpc_delete_document_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_delete_document_proto_rawDescData) + }) + return file_rpc_delete_document_proto_rawDescData +} + +var file_rpc_delete_document_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rpc_delete_document_proto_goTypes = []interface{}{ + (*DeleteDocumentRequest)(nil), // 0: pb.DeleteDocumentRequest + (*DeleteDocumentResponse)(nil), // 1: pb.DeleteDocumentResponse +} +var file_rpc_delete_document_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rpc_delete_document_proto_init() } +func file_rpc_delete_document_proto_init() { + if File_rpc_delete_document_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpc_delete_document_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_delete_document_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDocumentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_delete_document_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_delete_document_proto_goTypes, + DependencyIndexes: file_rpc_delete_document_proto_depIdxs, + MessageInfos: file_rpc_delete_document_proto_msgTypes, + }.Build() + File_rpc_delete_document_proto = out.File + file_rpc_delete_document_proto_rawDesc = nil + file_rpc_delete_document_proto_goTypes = nil + file_rpc_delete_document_proto_depIdxs = nil +} diff --git a/bff/pb/service_df.pb.go b/bff/pb/service_df.pb.go index 7aca2d0..79d811e 100644 --- a/bff/pb/service_df.pb.go +++ b/bff/pb/service_df.pb.go @@ -64,223 +64,235 @@ var file_service_df_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0xce, 0x19, 0x0a, 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, - 0x2a, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, - 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0xa4, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x2f, 0x12, - 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, - 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, - 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, - 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x4f, 0x92, 0x41, 0x27, 0x12, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, + 0x6f, 0x1a, 0x19, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x64, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf0, 0x1a, 0x0a, + 0x02, 0x64, 0x66, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, + 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x68, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0xa4, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x2f, 0x12, 0x1b, 0x4c, 0x69, 0x73, 0x74, + 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, + 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x92, 0x41, + 0x27, 0x12, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x92, 0x01, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, + 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x92, 0x41, 0x2d, + 0x12, 0x19, 0x47, 0x65, 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x62, 0x79, + 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x32, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x55, 0x92, 0x41, 0x2d, 0x12, 0x19, 0x47, 0x65, 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x96, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x2e, - 0x12, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, - 0x5b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x5d, 0x62, 0x10, 0x0a, 0x0e, - 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x12, 0x7f, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x92, 0x41, 0x10, 0x12, 0x0e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, + 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x12, 0x96, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x2e, 0x12, 0x1a, 0x4c, 0x69, 0x73, + 0x74, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x5b, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x5d, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x39, 0x92, 0x41, 0x10, 0x12, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x91, 0x01, 0x0a, + 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x64, 0x92, 0x41, 0x33, 0x12, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, - 0x01, 0x2a, 0x32, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, - 0x12, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, - 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, - 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, 0x12, 0x0d, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, 0x10, 0x0a, - 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x32, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, - 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x12, 0x84, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, - 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, - 0x92, 0x41, 0x24, 0x12, 0x10, 0x47, 0x65, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, - 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, - 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x0c, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, - 0x92, 0x41, 0x27, 0x12, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, - 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, - 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, - 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x5e, 0x92, 0x41, 0x2e, 0x12, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x10, 0x0a, + 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0xbf, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x92, 0x41, + 0x33, 0x12, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x20, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x32, 0x23, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x63, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, 0x12, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, 0x21, 0x12, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, + 0x3a, 0x01, 0x2a, 0x32, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, + 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x84, + 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, + 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x92, 0x41, 0x24, 0x12, 0x10, + 0x47, 0x65, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, + 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, + 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x27, 0x12, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x20, 0x62, 0x79, + 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9e, 0x01, 0x0a, 0x0b, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x92, 0x41, + 0x2e, 0x12, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x20, + 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x25, 0x12, 0x11, 0x47, 0x65, 0x74, 0x20, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, - 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x12, 0x99, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x28, 0x12, 0x14, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, - 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa4, - 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x2f, 0x12, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, - 0x22, 0x12, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xb0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x67, 0x92, 0x41, 0x30, 0x12, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x52, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x20, 0x62, 0x79, 0x20, 0x70, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, - 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, - 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, - 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xca, 0x02, 0x0a, - 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, + 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x2f, + 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, + 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x8a, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, + 0x92, 0x41, 0x25, 0x12, 0x11, 0x47, 0x65, 0x74, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x99, 0x01, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x28, 0x12, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, + 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa4, 0x01, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, + 0x41, 0x2f, 0x12, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x62, + 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, + 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x10, 0x0a, 0x0e, + 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x32, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xb0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, + 0x92, 0x41, 0x30, 0x12, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x73, 0x4c, 0x6f, 0x67, 0x20, 0x62, 0x79, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, + 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x7b, 0x70, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xca, 0x02, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x02, 0x92, 0x41, 0xe0, 0x01, 0x12, 0x1b, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, - 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x48, 0x54, 0x54, 0x50, 0x5d, 0x1a, 0xae, 0x01, 0x54, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x69, 0x61, 0x20, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, - 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, - 0x2e, 0x20, 0x54, 0x72, 0x79, 0x20, 0x60, 0x60, 0x60, 0x63, 0x75, 0x72, 0x6c, 0x20, 0x2d, 0x58, - 0x20, 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2d, 0x48, 0x20, 0x22, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, - 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x66, 0x69, 0x6c, - 0x65, 0x3d, 0x40, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, - 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x3d, - 0x31, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x55, 0x52, 0x49, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x60, 0x60, 0x60, 0x62, 0x10, 0x0a, 0x0e, 0x0a, - 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, - 0x64, 0x66, 0x42, 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, - 0x41, 0x50, 0x49, 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, - 0x40, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, - 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, - 0x64, 0x66, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x80, 0x02, 0x92, 0x41, 0xe0, 0x01, 0x12, 0x1b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5b, 0x6f, 0x6e, 0x6c, 0x79, 0x20, + 0x48, 0x54, 0x54, 0x50, 0x5d, 0x1a, 0xae, 0x01, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, + 0x76, 0x69, 0x61, 0x20, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x54, 0x72, 0x79, + 0x20, 0x60, 0x60, 0x60, 0x63, 0x75, 0x72, 0x6c, 0x20, 0x2d, 0x58, 0x20, 0x50, 0x4f, 0x53, 0x54, + 0x20, 0x2d, 0x48, 0x20, 0x22, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x3a, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, 0x7b, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x7d, 0x22, 0x20, 0x2d, 0x46, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x3d, 0x40, 0x2f, 0x70, + 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x2d, 0x46, 0x20, + 0x22, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x3d, 0x31, 0x22, 0x20, 0x22, 0x68, + 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x52, 0x49, + 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x22, 0x60, 0x60, 0x60, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, + 0x2a, 0x22, 0x11, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x75, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x9f, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, + 0x92, 0x41, 0x29, 0x12, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x62, 0x10, 0x0a, 0x0e, 0x0a, 0x0a, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x24, 0x2a, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x1a, 0x07, 0x92, 0x41, 0x04, 0x12, 0x02, 0x64, 0x66, 0x42, + 0xb0, 0x01, 0x92, 0x41, 0x93, 0x01, 0x12, 0x44, 0x0a, 0x06, 0x64, 0x66, 0x20, 0x41, 0x50, 0x49, + 0x22, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x12, 0x1c, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, + 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x1a, 0x0d, 0x64, 0x65, 0x76, 0x40, 0x69, 0x74, + 0x73, 0x73, 0x63, 0x62, 0x2e, 0x64, 0x65, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, + 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x23, 0x0a, 0x21, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x41, 0x75, 0x74, 0x68, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x74, 0x73, 0x73, 0x63, 0x62, 0x2f, 0x64, 0x66, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_service_df_proto_goTypes = []interface{}{ @@ -305,27 +317,29 @@ var file_service_df_proto_goTypes = []interface{}{ (*UpdatePaymentRequest)(nil), // 18: pb.UpdatePaymentRequest (*ListReturnsLogRequest)(nil), // 19: pb.ListReturnsLogRequest (*UploadDocumentRequest)(nil), // 20: pb.UploadDocumentRequest - (*LoginResponse)(nil), // 21: pb.LoginResponse - (*RefreshTokenResponse)(nil), // 22: pb.RefreshTokenResponse - (*ListSessionsResponse)(nil), // 23: pb.ListSessionsResponse - (*BlockSessionResponse)(nil), // 24: pb.BlockSessionResponse - (*GetAccountResponse)(nil), // 25: pb.GetAccountResponse - (*ListAccountsResponse)(nil), // 26: pb.ListAccountsResponse - (*CreateAccountResponse)(nil), // 27: pb.CreateAccountResponse - (*UpdateAccountResponse)(nil), // 28: pb.UpdateAccountResponse - (*UpdateAccountPrivacyResponse)(nil), // 29: pb.UpdateAccountPrivacyResponse - (*CreatePersonResponse)(nil), // 30: pb.CreatePersonResponse - (*UpdatePersonResponse)(nil), // 31: pb.UpdatePersonResponse - (*GetPersonResponse)(nil), // 32: pb.GetPersonResponse - (*DeletePersonResponse)(nil), // 33: pb.DeletePersonResponse - (*ListPersonsResponse)(nil), // 34: pb.ListPersonsResponse - (*CreatePaymentResponse)(nil), // 35: pb.CreatePaymentResponse - (*GetPaymentResponse)(nil), // 36: pb.GetPaymentResponse - (*DeletePaymentResponse)(nil), // 37: pb.DeletePaymentResponse - (*ListPaymentsResponse)(nil), // 38: pb.ListPaymentsResponse - (*UpdatePaymentResponse)(nil), // 39: pb.UpdatePaymentResponse - (*ListReturnsLogResponse)(nil), // 40: pb.ListReturnsLogResponse - (*UploadDocumentResponse)(nil), // 41: pb.UploadDocumentResponse + (*DeleteDocumentRequest)(nil), // 21: pb.DeleteDocumentRequest + (*LoginResponse)(nil), // 22: pb.LoginResponse + (*RefreshTokenResponse)(nil), // 23: pb.RefreshTokenResponse + (*ListSessionsResponse)(nil), // 24: pb.ListSessionsResponse + (*BlockSessionResponse)(nil), // 25: pb.BlockSessionResponse + (*GetAccountResponse)(nil), // 26: pb.GetAccountResponse + (*ListAccountsResponse)(nil), // 27: pb.ListAccountsResponse + (*CreateAccountResponse)(nil), // 28: pb.CreateAccountResponse + (*UpdateAccountResponse)(nil), // 29: pb.UpdateAccountResponse + (*UpdateAccountPrivacyResponse)(nil), // 30: pb.UpdateAccountPrivacyResponse + (*CreatePersonResponse)(nil), // 31: pb.CreatePersonResponse + (*UpdatePersonResponse)(nil), // 32: pb.UpdatePersonResponse + (*GetPersonResponse)(nil), // 33: pb.GetPersonResponse + (*DeletePersonResponse)(nil), // 34: pb.DeletePersonResponse + (*ListPersonsResponse)(nil), // 35: pb.ListPersonsResponse + (*CreatePaymentResponse)(nil), // 36: pb.CreatePaymentResponse + (*GetPaymentResponse)(nil), // 37: pb.GetPaymentResponse + (*DeletePaymentResponse)(nil), // 38: pb.DeletePaymentResponse + (*ListPaymentsResponse)(nil), // 39: pb.ListPaymentsResponse + (*UpdatePaymentResponse)(nil), // 40: pb.UpdatePaymentResponse + (*ListReturnsLogResponse)(nil), // 41: pb.ListReturnsLogResponse + (*UploadDocumentResponse)(nil), // 42: pb.UploadDocumentResponse + (*DeleteDocumentResponse)(nil), // 43: pb.DeleteDocumentResponse } var file_service_df_proto_depIdxs = []int32{ 0, // 0: pb.df.Login:input_type -> pb.LoginRequest @@ -349,29 +363,31 @@ var file_service_df_proto_depIdxs = []int32{ 18, // 18: pb.df.UpdatePayment:input_type -> pb.UpdatePaymentRequest 19, // 19: pb.df.ListReturnsLog:input_type -> pb.ListReturnsLogRequest 20, // 20: pb.df.UploadDocument:input_type -> pb.UploadDocumentRequest - 21, // 21: pb.df.Login:output_type -> pb.LoginResponse - 22, // 22: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse - 23, // 23: pb.df.ListSessions:output_type -> pb.ListSessionsResponse - 24, // 24: pb.df.BlockSession:output_type -> pb.BlockSessionResponse - 25, // 25: pb.df.GetAccount:output_type -> pb.GetAccountResponse - 26, // 26: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse - 27, // 27: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse - 28, // 28: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse - 29, // 29: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse - 30, // 30: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse - 31, // 31: pb.df.UpdatePerson:output_type -> pb.UpdatePersonResponse - 32, // 32: pb.df.GetPerson:output_type -> pb.GetPersonResponse - 33, // 33: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse - 34, // 34: pb.df.ListPersons:output_type -> pb.ListPersonsResponse - 35, // 35: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse - 36, // 36: pb.df.GetPayment:output_type -> pb.GetPaymentResponse - 37, // 37: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse - 38, // 38: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse - 39, // 39: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse - 40, // 40: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse - 41, // 41: pb.df.UploadDocument:output_type -> pb.UploadDocumentResponse - 21, // [21:42] is the sub-list for method output_type - 0, // [0:21] is the sub-list for method input_type + 21, // 21: pb.df.DeleteDocument:input_type -> pb.DeleteDocumentRequest + 22, // 22: pb.df.Login:output_type -> pb.LoginResponse + 23, // 23: pb.df.RefreshToken:output_type -> pb.RefreshTokenResponse + 24, // 24: pb.df.ListSessions:output_type -> pb.ListSessionsResponse + 25, // 25: pb.df.BlockSession:output_type -> pb.BlockSessionResponse + 26, // 26: pb.df.GetAccount:output_type -> pb.GetAccountResponse + 27, // 27: pb.df.ListAccounts:output_type -> pb.ListAccountsResponse + 28, // 28: pb.df.CreateAccount:output_type -> pb.CreateAccountResponse + 29, // 29: pb.df.UpdateAccount:output_type -> pb.UpdateAccountResponse + 30, // 30: pb.df.UpdateAccountPrivacy:output_type -> pb.UpdateAccountPrivacyResponse + 31, // 31: pb.df.CreatePerson:output_type -> pb.CreatePersonResponse + 32, // 32: pb.df.UpdatePerson:output_type -> pb.UpdatePersonResponse + 33, // 33: pb.df.GetPerson:output_type -> pb.GetPersonResponse + 34, // 34: pb.df.DeletePerson:output_type -> pb.DeletePersonResponse + 35, // 35: pb.df.ListPersons:output_type -> pb.ListPersonsResponse + 36, // 36: pb.df.CreatePayment:output_type -> pb.CreatePaymentResponse + 37, // 37: pb.df.GetPayment:output_type -> pb.GetPaymentResponse + 38, // 38: pb.df.DeletePayment:output_type -> pb.DeletePaymentResponse + 39, // 39: pb.df.ListPayments:output_type -> pb.ListPaymentsResponse + 40, // 40: pb.df.UpdatePayment:output_type -> pb.UpdatePaymentResponse + 41, // 41: pb.df.ListReturnsLog:output_type -> pb.ListReturnsLogResponse + 42, // 42: pb.df.UploadDocument:output_type -> pb.UploadDocumentResponse + 43, // 43: pb.df.DeleteDocument:output_type -> pb.DeleteDocumentResponse + 22, // [22:44] is the sub-list for method output_type + 0, // [0:22] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -403,6 +419,7 @@ func file_service_df_proto_init() { file_rpc_block_session_proto_init() file_rpc_list_returns_log_by_person_id_proto_init() file_rpc_upload_document_proto_init() + file_rpc_delete_document_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/bff/pb/service_df.pb.gw.go b/bff/pb/service_df.pb.gw.go index 6c61027..3fe5b8e 100644 --- a/bff/pb/service_df.pb.gw.go +++ b/bff/pb/service_df.pb.gw.go @@ -909,6 +909,58 @@ func local_request_Df_UploadDocument_0(ctx context.Context, marshaler runtime.Ma } +func request_Df_DeleteDocument_0(ctx context.Context, marshaler runtime.Marshaler, client DfClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteDocument(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Df_DeleteDocument_0(ctx context.Context, marshaler runtime.Marshaler, server DfServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteDocumentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteDocument(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDfHandlerServer registers the http handlers for service Df to "mux". // UnaryRPC :call DfServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1440,6 +1492,31 @@ func RegisterDfHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("DELETE", pattern_Df_DeleteDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Df/DeleteDocument", runtime.WithHTTPPathPattern("/v1/documents/delete_document/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Df_DeleteDocument_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeleteDocument_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1943,6 +2020,28 @@ func RegisterDfHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("DELETE", pattern_Df_DeleteDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.Df/DeleteDocument", runtime.WithHTTPPathPattern("/v1/documents/delete_document/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Df_DeleteDocument_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Df_DeleteDocument_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1988,6 +2087,8 @@ var ( pattern_Df_ListReturnsLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "returns_log", "list_returns_log", "person_id"}, "")) pattern_Df_UploadDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"documents", "upload"}, "")) + + pattern_Df_DeleteDocument_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "documents", "delete_document", "id"}, "")) ) var ( @@ -2032,4 +2133,6 @@ var ( forward_Df_ListReturnsLog_0 = runtime.ForwardResponseMessage forward_Df_UploadDocument_0 = runtime.ForwardResponseMessage + + forward_Df_DeleteDocument_0 = runtime.ForwardResponseMessage ) diff --git a/bff/pb/service_df_grpc.pb.go b/bff/pb/service_df_grpc.pb.go index e5d300c..c89183f 100644 --- a/bff/pb/service_df_grpc.pb.go +++ b/bff/pb/service_df_grpc.pb.go @@ -40,6 +40,7 @@ const ( Df_UpdatePayment_FullMethodName = "/pb.df/UpdatePayment" Df_ListReturnsLog_FullMethodName = "/pb.df/ListReturnsLog" Df_UploadDocument_FullMethodName = "/pb.df/UploadDocument" + Df_DeleteDocument_FullMethodName = "/pb.df/DeleteDocument" ) // DfClient is the client API for Df service. @@ -67,6 +68,7 @@ type DfClient interface { UpdatePayment(ctx context.Context, in *UpdatePaymentRequest, opts ...grpc.CallOption) (*UpdatePaymentResponse, error) ListReturnsLog(ctx context.Context, in *ListReturnsLogRequest, opts ...grpc.CallOption) (*ListReturnsLogResponse, error) UploadDocument(ctx context.Context, in *UploadDocumentRequest, opts ...grpc.CallOption) (*UploadDocumentResponse, error) + DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*DeleteDocumentResponse, error) } type dfClient struct { @@ -266,6 +268,15 @@ func (c *dfClient) UploadDocument(ctx context.Context, in *UploadDocumentRequest return out, nil } +func (c *dfClient) DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*DeleteDocumentResponse, error) { + out := new(DeleteDocumentResponse) + err := c.cc.Invoke(ctx, Df_DeleteDocument_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DfServer is the server API for Df service. // All implementations must embed UnimplementedDfServer // for forward compatibility @@ -291,6 +302,7 @@ type DfServer interface { UpdatePayment(context.Context, *UpdatePaymentRequest) (*UpdatePaymentResponse, error) ListReturnsLog(context.Context, *ListReturnsLogRequest) (*ListReturnsLogResponse, error) UploadDocument(context.Context, *UploadDocumentRequest) (*UploadDocumentResponse, error) + DeleteDocument(context.Context, *DeleteDocumentRequest) (*DeleteDocumentResponse, error) mustEmbedUnimplementedDfServer() } @@ -361,6 +373,9 @@ func (UnimplementedDfServer) ListReturnsLog(context.Context, *ListReturnsLogRequ func (UnimplementedDfServer) UploadDocument(context.Context, *UploadDocumentRequest) (*UploadDocumentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UploadDocument not implemented") } +func (UnimplementedDfServer) DeleteDocument(context.Context, *DeleteDocumentRequest) (*DeleteDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDocument not implemented") +} func (UnimplementedDfServer) mustEmbedUnimplementedDfServer() {} // UnsafeDfServer may be embedded to opt out of forward compatibility for this service. @@ -752,6 +767,24 @@ func _Df_UploadDocument_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Df_DeleteDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfServer).DeleteDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Df_DeleteDocument_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfServer).DeleteDocument(ctx, req.(*DeleteDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Df_ServiceDesc is the grpc.ServiceDesc for Df service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -843,6 +876,10 @@ var Df_ServiceDesc = grpc.ServiceDesc{ MethodName: "UploadDocument", Handler: _Df_UploadDocument_Handler, }, + { + MethodName: "DeleteDocument", + Handler: _Df_DeleteDocument_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_df.proto", diff --git a/bff/proto/rpc_delete_document.proto b/bff/proto/rpc_delete_document.proto new file mode 100644 index 0000000..6427144 --- /dev/null +++ b/bff/proto/rpc_delete_document.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package pb; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/itsscb/df/pb"; + +message DeleteDocumentRequest { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Document"; + description: "Delete a Document"; + required: [ + "id" + ]; + }; + example: "{\"id\": \"1\"}" + }; + uint64 id = 1; +} + +message DeleteDocumentResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "Delete Document Response"; + }; + example: "{\"id\": \"1\", \"deleted\": true}" + }; + uint64 id = 1; + bool deleted = 2; +} \ No newline at end of file diff --git a/bff/proto/service_df.proto b/bff/proto/service_df.proto index 47133ae..46de630 100644 --- a/bff/proto/service_df.proto +++ b/bff/proto/service_df.proto @@ -31,6 +31,7 @@ import "rpc_block_session.proto"; import "rpc_list_returns_log_by_person_id.proto"; import "rpc_upload_document.proto"; +import "rpc_delete_document.proto"; option go_package = "github.com/itsscb/df/pb"; @@ -349,4 +350,18 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } }; }; + rpc DeleteDocument (DeleteDocumentRequest) returns (DeleteDocumentResponse) { + option (google.api.http) = { + delete: "/v1/documents/delete_document/{id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Delete Document by ID" + security: { + security_requirement: { + key: "BearerAuth"; + value: {} + } + } + }; + }; }; \ No newline at end of file