Skip to content

Rebtel-Api

Consuming Rebtel Internal (Minority) APIs

Prerequisites

Rebtel API client NuGet package is available at Azure DevOps Artifacts.
Follow this instructions to setup your Visual Studio instance.

Updating Rebtel APIs

The API contracts and client assemblies are located in API area of Rebtel Backend (Api.sln).
To add a new API:
1. Add new API in Rebtel.Minority.Api.Contracts.
- Copy of original contracts into a separate namespace in Rebtel.Minority.Api.Contracts project
- Remove DataMember/DataContract attributes
2. Implement it in Rebtel.Minority.Api application
- Add new controller class and implement the service contract
- Register AutoMapper configuration file for new service models
3. Update mappings test in Rebtel.Minority.Api.Test project
4. Implement integration tests in Rebtel.Minority.Api.IntegrationTest
4. Submit Pull Request

This will trigger minority-api build that will build your changes and publish new version of Minority API NuGet packages to rebtel-backend NuGet feed.

Update NuGet references in Minority.Bank.sln

Design Guidelines

Expose rebtel services and their models as is, but:
- don't copy NullableBoolean, NullableDecimal, NullableInteger and etc. types. Replace them with normal nullable types. The mappings to convert NullableT to standard Nullable are already available in RebtelCommonMappings
- don't return ServiceReply, return it's Value instead
- drop ResultCode and other properties from non generic ServiceReply types
- use ServiceReplyExtensions methods to ensure successful result code or throw and ApiException

Consuming Rebtel APIs

  1. Add a reference to Rebtel.Core.Infrastructure.ServiceClient project
  2. Register InternalApiClientModule
  3. Register a service you want to call:
    builder.RegisterRebtelApiClient<IRebtelOrderService>();
    
  4. Don't forget to reference rebtel-api config in your app's helm chart