My project is a billing system for airlines using local airports.
we have Airports, Resources, Agents and Airlines.
- Resources: Resources in the airport used by airlines. Each resource has Tariffs with From-To intervals
- Agents: Companies who register with us to make their related airlines use specific resources in time intervals (From-To) for each airport and according to contracts each agent and each airline may have its own billed value (different than the Tariff specified for the selected resource).
- Airlines: individual airlines who are exactly like agents
except that they don't have other related airlines and they are treated in bills different than agents.
The problem is:
as you can see, I have more than one time interval that i have to validate and handle. Consider the following scenario to simplify it:
1. 'Swiss Air' is an airline that's handled by an agent called 'Tiger' from 1-Feb-2005 to 15-May-2005. 'Swiss Air' will join other agent called 'Lotus' from 16-May-2005 to 'Not specified'.
2. A resource called 'DCS' has 'Tariff 1' from 1-Jan-2005 to 10-Apr-2005 ($1.5) and 'Tariff 2' from 11-Apr-2005 to 1-Sep-2005 ($2.0).
3. At the proposed view I want to assign:
'Tiger' / 'Swiss Air' at 'Cairo Airport' uses the resource 'DCS' from 1-Feb-2005 to 1-Mar-2005 ($1.3) and at 'Sharm airport' uses the resource 'DCS' from 1-Feb-2005 to 1-Apr-2005 ($1.0). and so on with hundreds of airlines and agents and about 10 resorces!
Any one can help me to validate these time intervals? knowing that I'v already implemented (Agent/Airline) and (Resource/Tariff) and time intervals are valid till now.
we have Airports, Resources, Agents and Airlines.
- Resources: Resources in the airport used by airlines. Each resource has Tariffs with From-To intervals
- Agents: Companies who register with us to make their related airlines use specific resources in time intervals (From-To) for each airport and according to contracts each agent and each airline may have its own billed value (different than the Tariff specified for the selected resource).
- Airlines: individual airlines who are exactly like agents
except that they don't have other related airlines and they are treated in bills different than agents.
The problem is:
as you can see, I have more than one time interval that i have to validate and handle. Consider the following scenario to simplify it:
1. 'Swiss Air' is an airline that's handled by an agent called 'Tiger' from 1-Feb-2005 to 15-May-2005. 'Swiss Air' will join other agent called 'Lotus' from 16-May-2005 to 'Not specified'.
2. A resource called 'DCS' has 'Tariff 1' from 1-Jan-2005 to 10-Apr-2005 ($1.5) and 'Tariff 2' from 11-Apr-2005 to 1-Sep-2005 ($2.0).
3. At the proposed view I want to assign:
'Tiger' / 'Swiss Air' at 'Cairo Airport' uses the resource 'DCS' from 1-Feb-2005 to 1-Mar-2005 ($1.3) and at 'Sharm airport' uses the resource 'DCS' from 1-Feb-2005 to 1-Apr-2005 ($1.0). and so on with hundreds of airlines and agents and about 10 resorces!
Any one can help me to validate these time intervals? knowing that I'v already implemented (Agent/Airline) and (Resource/Tariff) and time intervals are valid till now.