Skip to main content

Documentation Index

Fetch the complete documentation index at: https://revrebel-sync-metrics-library.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Source, Channel, and Rate Model

Source, channel, agency, company, consortia, and rate data sit at the messy intersection of distribution, sales, marketing, revenue strategy, and finance. Every hotel system has its own version of the truth. Sometimes it is a source. Sometimes it is a subsource. Sometimes it is a channel. Sometimes it is a rate code wearing a trench coat. The Metrics model separates these concepts into controlled lookup tables, then uses mapping tables to translate source-system values into the standard structure. The goal is not to force every source system into the same shape. The goal is to give Metrics a clean, consistent reporting layer while preserving enough flexibility to handle systems that do not have every level of hierarchy.

How We View Source and Rate Data

Source and channel data explain how demand enters the hotel. Rate and company data explain why the booking exists, how it should be priced, and how it should roll into commercial and finance reporting. Consortia and agency data add another layer of distribution context, especially for GDS and negotiated travel business. These concepts overlap, but they should not be collapsed into one flat field. A booking can have a channel, source, subsource, rate type, rate code, company, agency, consortia, segment, and finance treatment. Each one answers a different business question. Metrics keeps those relationships explicit so reporting can answer the practical questions: Where did the booking come from? What commercial bucket does it belong to? Which rate structure drove it? Which company or agency influenced it? And does finance agree, or are we having that meeting again?

Table Family

TablePurpose
lkp_consortia_categoryControlled list of consortia categories.
lkp_consortia_focusControlled list of consortia focus areas.
lkp_consortiaControlled consortia reference table.
lkp_agencyAgency and IATA reference table.
lkp_industryControlled industry category and industry table.
lkp_companyCompany, corporate account, and profile reference table.
lkp_sourceControlled list of standard sources.
lkp_subsourceControlled list of standard subsources.
lkp_channel_groupControlled list of high-level channel groups.
lkp_channelControlled list of standard channels.
lkp_ratetypeControlled list of rate types.
lkp_rateControlled list of standard rates and rate attributes.
map_sourceSource-system source/subsource mapping table.
map_rateSource-system rate mapping table.
vw_sourceEnriched source/subsource/channel view for reporting.
vw_rateEnriched rate view for reporting.

Consortia Lookup Tables

lkp_consortia_category

Consortia category defines the broad type of consortia relationship.
ColumnTypeDefinition
codeSTRINGStandard consortia category code.
nameSTRINGConsortia category display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_consortia_focus

Consortia focus defines the primary commercial focus or audience of the consortia relationship.
ColumnTypeDefinition
codeSTRINGStandard consortia focus code.
nameSTRINGConsortia focus display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_consortia

lkp_consortia stores the standard consortia reference list.
ColumnTypeDefinition
codeSTRINGStandard consortia code.
nameSTRINGFull consortia name.
short_nameSTRINGShort display name used in reporting.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
consortia_focus_codeSTRINGStandard consortia focus code. Joins to lkp_consortia_focus.code.
consortia_category_codeSTRINGStandard consortia category code. Joins to lkp_consortia_category.code.
is_activeBOOLIndicates whether the consortia value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

Agency, Industry, and Company Tables

lkp_agency

lkp_agency stores agency and IATA reference values. This is especially useful for GDS, consortia, corporate, and negotiated production analysis.
ColumnTypeDefinition
iataSTRINGIATA number or agency identifier.
nameSTRINGAgency name.
corp_profileSTRINGCorporate profile or agency profile reference, when supplied.
corporate_codeSTRINGCorporate code associated with the agency, when available.
consortia_codeSTRINGStandard consortia code. Joins to lkp_consortia.code.
consortia_short_nameSTRINGShort consortia name for easy display and source compatibility.
rate_typeSTRINGRate type or negotiated rate classification associated with the agency, when supplied.
is_activeBOOLIndicates whether the agency record is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_industry

lkp_industry defines controlled industry values used by company and account reporting.
ColumnTypeDefinition
categorySTRINGHigh-level industry category.
industrySTRINGIndustry name.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the industry value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_company

lkp_company stores company, corporate account, and profile reference values.
ColumnTypeDefinition
codeSTRINGStandard company or account code.
nameSTRINGCompany or account name.
descriptionSTRINGCompany description or usage notes.
categorySTRINGCompany category.
industrySTRINGIndustry value. Can join to lkp_industry.industry when standardized.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the company value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

Source and Channel Lookup Tables

lkp_source

lkp_source defines the standard source value used by Metrics.
ColumnTypeDefinition
codeSTRINGStandard source code.
nameSTRINGSource display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
sourceSTRINGOptional source family or legacy source label when a source needs to be grouped under a broader source value.
is_activeBOOLIndicates whether the source value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_subsource

lkp_subsource defines the standard subsource value used by Metrics when the source system supports a subsource level.
ColumnTypeDefinition
codeSTRINGStandard subsource code.
nameSTRINGSubsource display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the subsource value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_channel_group

lkp_channel_group defines the high-level channel grouping used by reporting.
ColumnTypeDefinition
codeSTRINGStandard channel group code.
nameSTRINGChannel group display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the channel group is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_channel

lkp_channel defines the standard channel used by Metrics.
ColumnTypeDefinition
codeSTRINGStandard channel code.
nameSTRINGChannel display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
channel_group_codeSTRINGStandard channel group code. Joins to lkp_channel_group.code.
is_activeBOOLIndicates whether the channel value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

Rate Lookup Tables

lkp_ratetype

lkp_ratetype defines the standard rate type used by Metrics.
ColumnTypeDefinition
codeSTRINGStandard rate type code.
nameSTRINGRate type display name.
descriptionSTRINGDefinition or usage notes.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the rate type is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

lkp_rate

lkp_rate defines standard rate codes and their related commercial attributes.
ColumnTypeDefinition
codeSTRINGStandard rate code.
nameSTRINGRate display name.
descriptionSTRINGRate description or usage notes.
ratetype_codeSTRINGStandard rate type code. Joins to lkp_ratetype.code.
company_codeSTRINGStandard company code, when the rate is associated with a company. Joins to lkp_company.code.
segment_codeSTRINGStandard segment code. Joins to lkp_segment.code.
channel_codeSTRINGStandard channel code. Joins to lkp_channel.code.
source_codeSTRINGStandard source code. Joins to lkp_source.code.
subsource_codeSTRINGStandard subsource code, when applicable. Joins to lkp_subsource.code.
consortia_codeSTRINGStandard consortia code, when applicable. Joins to lkp_consortia.code.
sortINT64Display order for reporting.
is_activeBOOLIndicates whether the rate value is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

map_source

map_source is the source-to-standard translation table for source and subsource values. The mapping is universal by property and system. It is not tied to a specific ingestion report because the same source or subsource code can appear across many reports and workflows.

Why code_reference Exists

Some hotel systems provide both source and subsource. Others only provide one code. Metrics needs to map both patterns without inventing a fake hierarchy. code_reference tells the pipeline what the incoming source-system code represents:
code_referenceMeaning
source_codeThe source-system code maps to the standard source_code.
subsource_codeThe source-system code maps to the standard subsource_code.
When a system does not provide a true subsource, the target fact or snapshot table should populate:
subsource_code = source_code
That keeps fact tables structurally consistent while making it clear that no separate subsource was supplied. It is better than nulls everywhere, and much better than pretending the PMS had nuance it absolutely did not have.

Grain

property_code + system + code

Columns

ColumnTypeDefinition
property_codeSTRINGProperty code.
systemSTRINGSource system providing the source/subsource value.
codeSTRINGSource-system source or subsource code.
nameSTRINGSource-system source or subsource name.
descriptionSTRINGSource-system source or subsource description, if supplied.
code_referenceSTRINGIndicates whether code maps to source_code or subsource_code. Allowed values: source_code, subsource_code.
source_codeSTRINGStandard source code. Joins to lkp_source.code.
subsource_codeSTRINGStandard subsource code. Joins to lkp_subsource.code. If the source system does not have subsource, this may be filled with source_code in target fact tables.
channel_codeSTRINGStandard channel code. Joins to lkp_channel.code.
is_activeBOOLIndicates whether the mapping is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

map_rate

map_rate is the source-to-standard translation table for rate codes. Rate mapping does more than rename a rate. It connects the source-system rate code to rate type, company, segment, channel, source, subsource, and consortia context where available.

Grain

property_code + system + code

Columns

ColumnTypeDefinition
property_codeSTRINGProperty code.
systemSTRINGSource system providing the rate value.
codeSTRINGSource-system rate code.
nameSTRINGSource-system rate name.
descriptionSTRINGSource-system rate description, if supplied.
ratetype_codeSTRINGStandard rate type code. Joins to lkp_ratetype.code.
company_codeSTRINGStandard company code. Joins to lkp_company.code.
segment_codeSTRINGStandard segment code. Joins to lkp_segment.code.
channel_codeSTRINGStandard channel code. Joins to lkp_channel.code.
source_codeSTRINGStandard source code. Joins to lkp_source.code.
subsource_codeSTRINGStandard subsource code, when applicable. Joins to lkp_subsource.code.
consortia_codeSTRINGStandard consortia code, when applicable. Joins to lkp_consortia.code.
is_activeBOOLIndicates whether the mapping is active.
insert_dateDATEInsert date.
updated_dateDATEUpdated date.

Enriched Views

Views expose readable labels and sort fields so reporting tools display sources, channels, rates, companies, and consortia in the intended operating order instead of alphabetizing a commercial strategy into nonsense.

vw_source

vw_source joins mapped source/subsource values to source, subsource, channel, and channel group labels.
ColumnSourceDefinition
property_codemap_sourceProperty code.
systemmap_sourceSource system.
map_source_codemap_source.codeSource-system source/subsource code.
map_source_namemap_source.nameSource-system source/subsource name.
code_referencemap_sourceIndicates whether the mapped code resolves to source or subsource.
source_codemap_sourceStandard source code.
sourcelkp_source.nameStandard source name.
source_descriptionlkp_source.descriptionSource description.
source_sortlkp_source.sortSource display order.
subsource_codemap_sourceStandard subsource code.
subsourcelkp_subsource.nameStandard subsource name.
subsource_descriptionlkp_subsource.descriptionSubsource description.
subsource_sortlkp_subsource.sortSubsource display order.
channel_codemap_sourceStandard channel code.
channellkp_channel.nameStandard channel name.
channel_sortlkp_channel.sortChannel display order.
channel_group_codelkp_channel.channel_group_codeStandard channel group code.
channel_grouplkp_channel_group.nameStandard channel group name.
channel_group_sortlkp_channel_group.sortChannel group display order.
is_activemap_sourceActive mapping flag.

vw_rate

vw_rate joins mapped rate values to rate type, company, segment, channel, source, subsource, and consortia labels.
ColumnSourceDefinition
property_codemap_rateProperty code.
systemmap_rateSource system.
map_rate_codemap_rate.codeSource-system rate code.
map_rate_namemap_rate.nameSource-system rate name.
ratetype_codemap_rateStandard rate type code.
ratetypelkp_ratetype.nameStandard rate type name.
ratetype_sortlkp_ratetype.sortRate type display order.
company_codemap_rateStandard company code.
companylkp_company.nameCompany name.
company_categorylkp_company.categoryCompany category.
industrylkp_company.industryCompany industry.
segment_codemap_rateStandard segment code.
segmentlkp_segment.nameStandard segment name.
segment_sortlkp_segment.sortSegment display order.
channel_codemap_rateStandard channel code.
channellkp_channel.nameStandard channel name.
channel_sortlkp_channel.sortChannel display order.
source_codemap_rateStandard source code.
sourcelkp_source.nameStandard source name.
source_sortlkp_source.sortSource display order.
subsource_codemap_rateStandard subsource code.
subsourcelkp_subsource.nameStandard subsource name.
subsource_sortlkp_subsource.sortSubsource display order.
consortia_codemap_rateStandard consortia code.
consortialkp_consortia.nameConsortia name.
consortia_short_namelkp_consortia.short_nameConsortia short name.
consortia_sortlkp_consortia.sortConsortia display order.
is_activemap_rateActive mapping flag.

Relationship to Booking, Pace, Actuals, and Pricing

Source and rate mappings are used during ingestion to resolve source-system values into standard reporting codes. Example source resolution:
source file source/subsource code
  → map_source.code + map_source.code_reference
  → source_code / subsource_code / channel_code
  → target table source_code, subsource_code, channel_code
Example rate resolution:
source file rate code
  → map_rate.code
  → ratetype_code / company_code / segment_code / channel_code / source_code / subsource_code / consortia_code
  → target table rate and commercial attributes
Target tables may use these fields depending on grain and source availability:
source_code
subsource_code
channel_code
channel_group_code
rate_code
ratetype_code
company_code
segment_code
consortia_code
iata

Operating Notes

  1. Use lkp_, not lpk_, for lookup tables.
  2. Mapping tables are universal by property_code + system + code; they do not include report-level grain.
  3. Source reports belong in ingestion metadata, not source or rate mapping tables.
  4. code_reference is required in map_source because some systems map source and subsource differently, and some do not provide subsource at all.
  5. When no subsource exists, target fact/snapshot tables may set subsource_code = source_code to keep the model structurally consistent.
  6. Views should expose sort fields from lookup tables so Metrics can display values in the intended order.
  7. Keep agency, company, consortia, source, channel, and rate separate. They answer different questions, even when a source system tries to stuff them into one field.