syntax = "proto3"; import "google/protobuf/empty.proto"; import "google/protobuf/wrappers.proto"; package money; option go_package = "github.com/hub1989/jc-protobuf/money"; service AmountCollectedService { rpc getForEvent(google.protobuf.StringValue) returns (AmountCollectedResponse); rpc getByIds(StringListRequest) returns (AmountCollectedResponses); rpc getByEventIds(StringListRequest) returns (AmountCollectedResponses); rpc create(AmountCollectedRequest) returns (AmountCollectedResponse); rpc delete(google.protobuf.StringValue) returns (google.protobuf.Empty); rpc getAllAmountCollected(PageableRequest) returns (PageableAdminResponse); } service MoneyCollectedService { rpc addMoneyCollected(MoneyCollectedRequest) returns (MoneyCollectedResponse); rpc addMoneyCollectedToExistingAmountCollectedForEvent(MoneyRequest) returns (MoneyCollectedResponses); rpc deleteMoniesCollected(StringListRequest) returns (google.protobuf.Empty); rpc getRecordsBetweenPeriod(MoneyCollectedBetweenPeriodRequest) returns (MoneyCollectedResponses); } service ExchangeRateService { rpc getExchangeRateForCurrencyAndDate(ExchangeRateRequest) returns (ExchangeRateResponse); rpc getExchangeRatesForCurrency(google.protobuf.StringValue) returns (ExchangeRateResponses); rpc getExchangeRatesForDate(google.protobuf.StringValue) returns (ExchangeRateResponses); rpc getAllExchangeRates(google.protobuf.Empty) returns (ExchangeRateResponses); } service ComponentHealthService { rpc showDetails(google.protobuf.Empty) returns (InternalHealthResponse); } message MoneyCollectedBetweenPeriodRequest { google.protobuf.StringValue startTime = 1; google.protobuf.StringValue endTime = 2; } // Requests message StringListRequest { repeated google.protobuf.StringValue strings = 1; } message ExchangeRateRequest { string currency = 1; string date = 2; } message AmountCollectedRequest { string dateCollected = 1; string eventPid = 2; string recordedBy = 3; } message MoneyRequest { string eventPid = 1; repeated MoneyCollectedRequest moneyCollected = 2; } message MoneyCollectedRequest { string currencyCode = 1; int32 noOfCurrency = 2; int32 denomination = 3; MoneyCollectedType type = 4; google.protobuf.StringValue titheNumber = 5; string recordedBy = 6; string amountCollectedPid =7; } // Response message Rate { map rates = 1; string base = 2; string date = 3; int64 timestamp = 4; bool success = 5; bool historical = 6; } message AmountCollectedAuditLogResponse { string dateCreated = 1; string description = 2; string responsible = 3; int64 amountCollectedId = 4; string pid = 5; string amountCollectedPid = 6; } message MoneyCollectedResponses { repeated MoneyCollectedResponse moneyCollectedList = 1; } message MoneyCollectedResponse { string currencyCode = 1; double totalForOriginalCurrency = 2; double exchangeRate = 3; int32 noOfCurrency = 4; int32 denomination = 5; double totalInSEK = 6; MoneyCollectedType type = 7; string recordedBy = 8; string pid = 9; string amountCollectedPid = 10; string dateCreated = 11; } message InternalHealthResponse { string status = 1; string description = 2; map details = 3; string lastSeen = 4; string ipAddress = 5; } message ExchangeRateResponses { repeated ExchangeRateResponse exchangeResponseList = 1; } message ExchangeRateResponse { double rate = 1; string currencyCode = 2; string date = 3; } message PageRespDTO { int64 totalElements = 1; int32 totalPages = 2; repeated ExchangeRateResponse rates = 3; int32 pageNumber = 4; bool hasNext = 5; } message AmountCollectedResponse { double totalInSek = 1; string dateCollected = 2; repeated MoneyCollectedResponse moneyCollected = 3; repeated AmountCollectedAuditLogResponse auditLogs = 4; string pid = 5; string eventPid = 6; } message AmountCollectedResponses { repeated AmountCollectedResponse amountCollectedList = 1; } message PageableRequest { google.protobuf.Int64Value numberPerPage = 1; google.protobuf.StringValue lastItemId = 2; } message PageableAdminResponse { repeated AmountCollectedResponse data = 1; google.protobuf.Int64Value numberPerPage = 2; google.protobuf.StringValue lastItemId = 3; google.protobuf.Int64Value total = 4; google.protobuf.Int64Value noOfItemsInBatch = 5; } enum MoneyCollectedType { TITHE = 0; THANKSGIVING = 1; SEED = 2; OTHERS = 3; OFFERING = 4; }