Skip to content

Verify behavior of invoicing system with DAILY billing period #2005

@sbrossie

Description

@sbrossie

Write a test scenario (beatrix) to verify the following use case:

  1. Create account in America/New_York, refTime=2024-04-12 08:22:28, currency=USD, bcd=13
  2. Create a Subscription with Plan='plan-b' (see catalog below) starting on 2024-04-12 08:22:28 -> First invoice
  3. Move the clock to 2024-04-13 08:22:28 -> Second invoice
  4. Issue other invoice run with target date = 2024-04-13

Input catalog:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">

    <effectiveDate>1970-01-01T00:00:00Z</effectiveDate>
    <catalogName>DefaultCatalog</catalogName>
    <currencies>
        <currency>USD</currency>
    </currencies>
    <units/>
    <products>
        <product name="DefaultProduct" prettyName="DefaultProduct">
            <category>STANDALONE</category>
            <included/>
            <available/>
            <limits/>
        </product>
    </products>
    <rules>
        <changePolicy>
            <changePolicyCase>
                <policy>IMMEDIATE</policy>
            </changePolicyCase>
        </changePolicy>
        <changeAlignment/>
        <cancelPolicy>
            <cancelPolicyCase>
                <policy>END_OF_TERM</policy>
            </cancelPolicyCase>
        </cancelPolicy>
        <createAlignment/>
        <billingAlignment/>
        <priceList/>
    </rules>
    <plans>
        <plan name="plan-b">
            <product>DefaultProduct</product>
            <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
            <initialPhases>
                <phase type="TRIAL">
                    <duration>
                        <unit>DAYS</unit>
                        <number>1</number>
                    </duration>
                    <fixed>
                        <fixedPrice>
                        </fixedPrice>

                    </fixed>
                    <usages/>
                </phase>
            </initialPhases>
            <finalPhase type="EVERGREEN">
                <duration>
                    <unit>UNLIMITED</unit>
                    <number>-1</number>
                </duration>
                <recurring>
                    <billingPeriod>DAILY</billingPeriod>
                    <recurringPrice>
                        <price>
                            <currency>USD</currency>
                            <value>1.00</value>
                        </price>
                    </recurringPrice>
                </recurring>
                <usages/>
            </finalPhase>
            <plansAllowedInBundle>-1</plansAllowedInBundle>
        </plan>
    </plans>
    <priceLists>
        <defaultPriceList name="DEFAULT">
            <plans>
                <plan>plan-b</plan>
            </plans>
        </defaultPriceList>
    </priceLists>
</catalog>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions