<?xml version="1.0" ?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
	<table name="quote">
        <column xsi:type="decimal" name="bloyal_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount"/>
        <column xsi:type="decimal" name="bloyal_shipping_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Shipping Discount"/>
        <column xsi:type="varchar" length="255" name="bloyal_discount_coupon" nullable="true" comment="Bloyal Discount Coupon"/>
        <column xsi:type="text" name="bloyal_discount_reason" nullable="true" comment="Bloyal Discount Reason Json"/>
        <column xsi:type="text" name="bloyal_loyalty_summary" nullable="true" comment="Bloyal Loyalty Summary Json"/>
        <column xsi:type="text" name="bloyal_cart_uid" nullable="true" comment="Bloyal Cart Uid"/>
        <column xsi:type="varchar" length="10" name="bloyal_customer_verified" nullable="true" comment="Bloyal Customer Verified"/>
		<column xsi:type="decimal" name="giftcard_amount_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Gift Card Amount"/>
        <column xsi:type="varchar" name="giftcard_transaction_code" nullable="true" length="40" comment="Bloyal Giftcard Transaction Code"/>
		<column xsi:type="decimal" name="loyalty_dollar_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Dollar Amount"/>
		<column xsi:type="text" name="bloyal_lines_item_uid" nullable="true" comment="Bloyal Lines Item Uid"/>
        <column xsi:type="varchar" name="loyalty_dollar_transaction_code" nullable="true" length="40" comment="Loyalty Dollar Transaction Code"/>
        <column xsi:type="varchar" name="stored_payment_transaction_code" nullable="true" length="40" comment="Stored Payment Transaction Code"/>
	</table>
	<table name="quote_item">
		<column xsi:type="decimal" name="bloyal_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Product Discount"/>
        <column xsi:type="text" name="bloyal_discount_reason" nullable="true" comment="Bloyal Discount Reason Json"/>
	</table>
    <table name="sales_order">
        <column xsi:type="decimal" name="bloyal_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount"/>
        <column xsi:type="decimal" name="bloyal_shipping_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Shipping Discount"/>
        <column xsi:type="text" name="bloyal_discount_reason" nullable="true" comment="Bloyal Discount Reason Json"/>
        <column xsi:type="text" name="bloyal_loyalty_summary" nullable="true" comment="Bloyal Loyalty Summary Json"/>
        <column xsi:type="decimal" name="bloyal_discount_invoiced" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount Invoiced"/>
        <column xsi:type="decimal" name="bloyal_discount_refunded" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount Refunded"/>
		<column xsi:type="decimal" name="giftcard_amount_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Gift Card Amount"/>
        <column xsi:type="varchar" name="giftcard_transaction_code" nullable="true" length="40" comment="Bloyal Giftcard Transaction Code"/>
        <column xsi:type="decimal" name="bloyal_giftcard_invoiced" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Giftcard Discount Invoiced"/>
        <column xsi:type="decimal" name="bloyal_giftcard_refunded" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Giftcard Discount Refunded"/>
		<column xsi:type="decimal" name="loyalty_dollar_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Dollar Amount"/>
        <column xsi:type="varchar" name="loyalty_dollar_transaction_code" nullable="true" length="40" comment="Loyalty Dollar Transaction Code"/>
        <column xsi:type="varchar" name="stored_payment_transaction_code" nullable="true" length="40" comment="Stored Payment Transaction Code"/>
        <column xsi:type="decimal" name="bloyal_loyalty_invoiced" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Discount Invoiced"/>
        <column xsi:type="decimal" name="bloyal_loyalty_refunded" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Discount Refunded"/>
    </table>
    <table name="sales_invoice">
        <column xsi:type="decimal" name="bloyal_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount"/>
        <column xsi:type="decimal" name="bloyal_shipping_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Shipping Discount"/>
		<column xsi:type="decimal" name="giftcard_amount_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Gift Card Amount"/>
		<column xsi:type="decimal" name="loyalty_dollar_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Dollar Amount"/>
	</table>
    <table name="sales_creditmemo">
        <column xsi:type="decimal" name="bloyal_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Discount"/>
        <column xsi:type="decimal" name="bloyal_shipping_discount" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Shipping Discount"/>
		<column xsi:type="decimal" name="giftcard_amount_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Gift Card Amount"/>
		<column xsi:type="decimal" name="loyalty_dollar_used" scale="4" precision="20" unsigned="false" nullable="true" default="0" comment="Bloyal Loyalty Dollar Amount"/>
	</table>
	<table name="bloyal_service_url" resource="default" engine="innodb" comment="Bloyal Service Urls">
        <column xsi:type="varchar" length="255" name="service_type" nullable="false" comment="Service type"/>
        <column xsi:type="text" name="value" nullable="false" comment="Service Url"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="service_type"/>
        </constraint>
    </table>
</schema>
