CRS Summary - service_quotes Table

CRS Summary - service_quotes Table

This page documents the service_quotes table from the CRS Summary dataset. This table contains one row per shipping service quote per order, including selected, rejected, upgrade, and void service options.

Table Overview

Attribute

Value

Attribute

Value

Table Name

crs_summary_20262601_service_quotes

Database

fenix_tms_analytics_prod

Storage Location

s3://fenixlake/l1_processing/crs_summary/service_quotes/

File Format

Parquet (Snappy compressed)

Row Grain

One row per (order_id, service_quote_type, carrier_name, service_code)

Primary Key

order_id + service_quote_type + carrier_name + service_code (composite)

Approximate Volume

Source System

Elasticsearch (CRS Summary Index)

ETL Job

crs_summary_job_scaled.py

Refresh Frequency

Daily (Incremental)

Business Description

The service_quotes table captures all shipping service options evaluated by the Carrier Rate Shopping (CRS) system for each order. It provides:

  • Selected Service: The carrier/service actually chosen for shipping

  • Rejected Services: Alternative options that were considered but not chosen

  • Upgrade Service: Premium shipping option available to customer

  • Void Service: Service that was voided/cancelled

Key Business Use Cases:

  • Carrier rate comparison analysis

  • Cost savings calculation (selected vs. alternatives)

  • Transit time analysis by carrier/service

  • Carrier market share analysis

Service Quote types

service_quote_type

Source JSON Path

Description

Cardinality

service_quote_type

Source JSON Path

Description

Cardinality

selected

crs_shipment_summary.shipment_summary.service_summary

The service chosen for the order

0-1 per order

upgrade

crs_shipment_summary.shipment_summary.upgrade_service_summary

Premium upgrade option

0-1 per order

void

crs_shipment_summary.shipment_summary.crs_void_service_summary

Voided/cancelled service

0-1 per order

rejected

crs_shipment_summary.shipment_summary.rejected_service_summary[]

Services not selected

0-N per order

The rejected_service_summary is an ARRAY and is exploded to create multiple rows. Other service types are single objects with at most one row per order.

Source Mapping

Target Column

Source JSON Path

Transformation

Target Column

Source JSON Path

Transformation

doc_id

_id

Direct mapping

source_id

_source.id

Direct mapping

source_order_id

_source.order_id

Direct mapping

source_order_number

_source.order_number

Direct mapping

order_id

_source.order_id

Direct mapping

service_quote_type

N/A

Derived: Literal based on source path

carrier_name

{service_path}.carrier

Direct mapping

service_code

{service_path}.service.code

Direct mapping

service_name

{service_path}.service.name

Direct mapping (may be NULL)

expected_shipping_ts

{service_path}.transit_time_summary.expected_shipping_date

TO_TIMESTAMP()

expected_delivery_ts

{service_path}.transit_time_summary.expected_delivery_date

TO_TIMESTAMP()

transit_time_days

{service_path}.transit_time_summary.transit_time

Direct mapping

base_price_amount

{service_path}.base_price.amount

Direct mapping

base_price_currency

{service_path}.base_price.currency

Direct mapping

total_price_amount

{service_path}.total_price.amount

Direct mapping

total_price_currency

{service_path}.total_price.currency

Direct mapping

total_surcharges_amount

{service_path}.total_surcharges.amount

Direct mapping

total_surcharges_currency

{service_path}.total_surcharges.currency

Direct mapping

client_name

N/A

Enriched: From _index

order_year

created_date.utc_dttm

Derived: YEAR()

order_month

created_date.utc_dttm

Derived: MONTH()

order_date

created_date.utc_dttm

Derived: TO_DATE()

ingested_at_utc

N/A

System: CURRENT_TIMESTAMP()

Column Definitions

Identifier Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

doc_id

STRING

No

Elasticsearch document ID

9823192383842

source_id

STRING

No

Source system record ID

9823192383842

source_order_id

STRING

No

Original order ID

9823192383842

source_order_number

STRING

No

Human-readable order number

#26066057

order_id

STRING

No

Order identifier (FK to order_summary)

9823192383842

Service Identification Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

service_quote_type

STRING

No

Type of quote: selected, rejected, upgrade, void

selected

carrier_name

STRING

Yes

Shipping carrier name

USPS, UPS, FEDEX

service_code

STRING

No

Carrier service code

usps_ground_advantage

service_name

STRING

Yes

Human-readable service name

GROUND_HOME_DELIVERY

Transit Time Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

expected_shipping_ts

TIMESTAMP

Yes

Expected ship date/time

2025-07-23 11:00:00.000

expected_delivery_ts

TIMESTAMP

Yes

Expected delivery date/time

2025-07-28 11:00:00.000

transit_time_days

INTEGER

Yes

Number of transit days

4

Pricing Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

base_price_amount

DOUBLE

Yes

Base shipping rate before surcharges

4.37

base_price_currency

STRING

Yes

Currency for base price

USD

total_price_amount

DOUBLE

Yes

Total shipping cost including surcharges

4.37

total_price_currency

STRING

Yes

Currency for total price

USD

total_surcharges_amount

DOUBLE

Yes

Sum of all surcharges

0.0

total_surcharges_currency

STRING

Yes

Currency for surcharges

USD

Partition Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

client_name

STRING

No

Client/tenant identifier

🔎 bombas.myshopify.com - Google Search

order_year

INTEGER

No

Year order was created

2025

order_month

INTEGER

No

Month order was created (1-12)

7

order_date

DATE

No

Date order was created

2025-07-23

Audit Columns

Column Name

Data Type

Nullable

Description

Example

Column Name

Data Type

Nullable

Description

Example

ingested_at_utc

TIMESTAMP

No

When record was ingested

2026-01-31 11:02:57.622

Business Logic and Transformations

Union of Service Types

Four separate extractions are performed: 1. selected_df <- service_summary (single object) 2. upgrade_df <- upgrade_service_summary (single object) 3. void_df <- crs_void_service_summary (single object) 4. rejected_df <- rejected_service_summary (EXPLODE array) All four are combined using UNION BY NAME.

Pricing Calculations

total_price_amount = base_price_amount + total_surcharges_amount (This relationship should hold, but values come directly from source)

Data Quality Notes

Known Issues:
1. service_name may be NULL for some carriers (USPS, UPS)
2. Some orders may have 0 service quotes if CRS processing failed
3. transit_time_days may differ from actual calendar days between ship and delivery dates

Relationships

Related Table

Join Key(s)

Relationship

Related Table

Join Key(s)

Relationship