Terminado

Desarrollo de Script de Fechas Encimadas

Publicado el 17 Abril, 2019 en Programación y Tecnología

Sobre este proyecto

Abierto

Requirements
1. User is able to specify price depending on the dates. i.e. Set the price $x for the dates range $startDate - $endDate. Let’s call such ranges as intervals.
2. User can add as many intervals as he wants (using any start/end date).
3. System can’t have crossing intervals.
4. New interval price have higher priority over existing ones.
5. New interval can’t lead to changes in dates not belonged to its dates range.
6. If user tries to save interval that interferes with existing ones in DB, system has to
apply last user changes and modify other intervals in order to apply requirement
3.
7. Any intervals with the same price that can be merged (without gaps between)
should be merged.

DB
You need to develop a system for saving prices in intervals. Each interval should have such fields:
● date_start (date)
● date_end (date)
● price (float)
What you need to do:
Unit tests for what you consider to be necessary
● As minimum queries to DB as possible
● Well documented code

Examples
For intervals in examples used format (date_start-date_end:price), for example (1-10:15), that means that date_start = 1, date_end = 10, price = 15

Example 1
Step 1: Operation -> Add (1-10:15)  Result -> (1-10:15)
Step 2: Operation -> Add (5-20:15) Result -> (1-20:15)
Step 3: Operation -> Add (2-8:45)  Result -> (1-1:15), (2-8:45), (9-20:15)
Step 4: Operation -> Add (9-10:45) Result -> (1-1:15), (2-10:45), (11-20:15)

Example 2
Step 1: Operation -> Add (1-5:15) Result -> (1-5:15)
Step 2: Operation -> Add(20-25:15) Result -> (1-5:15), (20-25:15)
Step 3: Operation -> Add (4-21:45) Result -> (1-3:15), (4-21:45), (22-25:15)
Step 4: Operation -> Add (3-21:15) Result -> (1-25:15)

Categoría Programación y Tecnología
Subcategoría Programación Web
¿Cuál es el alcance del proyecto? Crear un nuevo sitio personalizado
¿Es un proyecto o una posición? Un proyecto
Actualmente tengo Tengo las especificaciones
Disponibilidad requerida Según se necesite
Roles necesarios Programador

Plazo de Entrega: No definido

Habilidades necesarias