https://jira.sixt.com/browse/RESDOL-532 We want to move more data to the cloud and reduce dependency on the monolith. Currently PHP endpoint that provides charge names exists. We want to replace it with goOrange service call. The service should has its own database and regularly collect updates from the monolith. Check this page for details: https://confluence.sixt.com/display/RAC/Moving+Offer+List+dependencies+from+monolith+to+goOrange ## service name com.sixt.service.rental-chargenames ## producer for the service Classic (needs to be created) ## consumers com.sixt.service.rentaloffers salesboost (presumably) ## stakeholders - Dolhins - Pricing team - Salesboost ## contract syntax = "proto3"; service RentalChargeNames { rpc WriteRACChargeNames(WriteRACChargeNamesRequest) returns (WriteRACChargeNamesResponse); rpc GetChargeNames(GetChargeNamesRequest) returns (GetChargeNamesResponse); } message WriteRACChargeNamesRequest { repeated RACChargeNames rac_charge_names = 1; } message RACChargeNames { string charge_code = 1; string valid_from = 2; // CEST timezone string valid_to = 3; // CEST timezone string short_name = 4; string long_name = 5; string web_description = 6; string web_description_html = 7; repeated string web_description_points = 8; repeated string web_description_points_html = 9; string lang = 10; string locale = 11; string pictogram = 12; string terms = 13; } message WriteRACChargeNamesResponse { enum Error { INTERNAL_ERROR = 1; DATABASE_ERROR = 2; ... } } message GetChargeNamesRequest { int64 pickup_station = 1; string pickup_date = 2; repeated string charge_codes = 3; string language = 4; string locale = 5; } message GetChargeNamesResponse { repeated ChargeName charge_names = 1; } message ChargeName { string id = 1; string short_name = 1; string long_name = 2; string description = 3; string description_html = 4; repeated string description_points = 5; repeated string description_points_html = 6; } ## tables **We need validity dates (from-to) and locale** #### charges | ID (PK) | code | short_name | long_name | lang | locale | pictogram | terms | | -------- | ----- | -------- | -------- |------| -------| ----------|-------| | SERIAL | Text | Text | Text | Text | Text | Text | Text | | cobol fld| chco | nash | nalg | | locl | | | composite key - {charge_code, language} ISO_country text region text district int64 branch_id int64 valid_from datetime valid_to datetime table in Oracle DB: COBSOFT.NRTCHBEZ #### descriptions | ID (PK) | description | bullet_points| | -------- | -------- |----- | | SERIAL | Text |[]Text #### charge_description | ID | description_id | | ----| -------- | | INT | INT | #### descriptions_html | ID (PK) | description_html_id | bullet_points| | -------- | -------- |----- | | SERIAL | Text |[]Text #### charge_description_html LISO | ID | description_id | | ----| -------- | | INT | INT | |idtwtw|country_iso|region|district|branch_id| |--|-----------|------|--------|---------| | 1 | "DE" | "" | 10 | 1000 | | 2 | "DE" | "" | 0 | 0 | | 3 | "" | "" | 10 | 0 | | 4 | "" | "" | 0 | 1000 | | 5 | "DE" | "" | 10 | 0 | ## selection hierarchy DECODE(liso, ' ', 0, POWER(2, 1)) + DECODE(rtar, ' ', 0, POWER(2, 2)) + DECODE(dist, 0 , 0, POWER(2, 3)) + DECODE(cit, 0 , 0, POWER(2, 4)) weight ## questions 1. It looks like we can put all the data into one table. Do we need a relational database here? ## current endpoint {{ php_rentaloffers.base_url }}/chargenames { "pickupStation": 11, "pickupDate": "2020-01-01", "chargeCodes": ["LD", "BF"] } { "LD": { "shortName": "Loss Damage Waiver", "longName": "Loss Damage Waiver", "pictogram": "LD_car", "termsConditionsAnchor": "LD", "webDescription": "Avoid high costs: Limit your responsibility for vehicle damage and theft", "webDescriptionHtml": "Avoid high costs: Limit your responsibility for vehicle damage and theft", "webDescriptionBulletPoints": [], "webDescriptionBulletPointsHtml": [] }, "BF": { "shortName": "minimum excess LDW", "longName": "Loss Damage Waiver (including Theft Protection) with minimum excess", "pictogram": "LD_car", "termsConditionsAnchor": "", "webDescription": "Our safest solution: Protection in the event of vehicle damage and theft", "webDescriptionHtml": "Our safest solution: Protection in the event of vehicle damage and theft", "webDescriptionBulletPoints": [], "webDescriptionBulletPointsHtml": [] } } We are also sending this using headers: ``` Sx-Language: en Sx-Locale: en_EN ```