Skip to content

Commit

Permalink
Merge pull request #123 from drypa/master
Browse files Browse the repository at this point in the history
merge from master
  • Loading branch information
drypa authored Feb 3, 2024
2 parents fd86d0c + 86f341d commit c206967
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 52 deletions.
94 changes: 76 additions & 18 deletions api/inside/accounts.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion api/inside/accounts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ message GetUsersResponse {

message UserRegistrationRequest {
int32 telegramId = 1;
string phoneNumber = 2;
}

message UserRegistrationResponse {
string userId = 1;
}
}

message PhoneVerificationRequest {
int32 telegramId = 1;
string code = 2;
}

101 changes: 69 additions & 32 deletions api/inside/contracts.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/inside/contracts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ service InternalApi {

}

rpc VerifyPhone(PhoneVerificationRequest) returns (ErrorResponse) {

}

rpc GetFirstUnckeckedRequest (NoParams) returns (ReceiptRequest) {

}
Expand Down
4 changes: 4 additions & 0 deletions backend/receipts/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func (p *Processor) GetRawReceipt(ctx context.Context, in *api.GetRawReceiptRepo
log.Printf("receipt with QR '%s' is not loaded from nalog.ru API\n", qr)
return nil, errors.New("raw receipt not found")
}
if r == nil || r.Ticket == nil || r.Ticket.Document == nil || r.Ticket.Document.Receipt == nil {
log.Printf("receipt document '%s' absent\n", qr)
return nil, errors.New("receipt document absent")
}

bytes, err := p.render.Receipt(r.Ticket.Document.Receipt)
return &api.RawReceiptReport{
Expand Down
1 change: 0 additions & 1 deletion backend/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func (r *Render) Receipt(receipt *nalogru.Receipt) ([]byte, error) {
log.Printf("failed to render receipt %v\n", err)
return nil, err
}
log.Println(tpl.String())
return tpl.Bytes(), nil
}

Expand Down

0 comments on commit c206967

Please sign in to comment.