HairSaloon: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Kaelias (talk | contribs)
Created page with "=Meeskond= *Kaido Henrik Elias *Arvo Paomees =Analüüs= ==Kirjeldus== HairSaloon on Eesti kõige modernsem ja kasutajasõbralikum barbershop e-teenus. Lehel on võimalik..."
 
Kaelias (talk | contribs)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 38: Line 38:
==Nice to have==
==Nice to have==


*Ühe broneeringuga saab valida mitut erinevat teenust
*Ühe broneeringuga saab valida mitut erinevat teenust -> done
*Juuksurile tagasiside andmine
*Juuksurile tagasiside andmine
*Broneeringu kinnituse saatmine juuksuri e-mailile
*Broneeringu kinnituse saatmine juuksuri e-mailile
Line 44: Line 44:


==Andmemudel==
==Andmemudel==
[[File:HairsaloonDBModel.png]]
== XML osa ==
=== XML Fail ===
<source lang="xml">
<?xml version="1.0" encoding="utf-8" ?>
<bookings>
  <booking id="1" totalCost="60" vip="true">
    <user id="1">
      <userName><![CDATA[Mirk Peek]]></userName>
      <userMail><![CDATA[mirkpeek@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-06:00</startTime>
        <endTime>2018-09-24-07:00</endTime>
        <workstation id="1">
          <workstationName><![CDATA[Tool1]]></workstationName>
        </workstation>
        <barber id="1">
          <barberName><![CDATA[Sven Tüüp]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="1" available="true">
        <productName><![CDATA[Juukselõikus masinaga]]></productName>
        <price currency="€">30</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
      <product id ="2" available="true">
        <productName><![CDATA[Värvimine paksu värviga]]></productName>
        <price currency="€">30</price>
        <productType id="2">
          <productTypeName><![CDATA[Värvimine]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
  <booking id="3" totalCost="45" vip="false">
    <user id="3">
      <userName><![CDATA[Siim Vene]]></userName>
      <userMail><![CDATA[siimvene@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-09:00</startTime>
        <endTime>2018-09-24-10:00</endTime>
        <workstation id="2">
          <workstationName> <![CDATA[Tool1]]></workstationName>
        </workstation>
        <barber id="1">
          <barberName><![CDATA[Sven Tüüp]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="3" available="true">
        <productName><![CDATA[Juukselõikus masinag ja kääridega]]></productName>
        <price currency="€">40</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
  <booking id="2" totalCost="30" vip="false">
    <user id="2">
      <userName><![CDATA[Kenn Koolak]]></userName>
      <userMail><![CDATA[kennkoolak@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-07:00</startTime>
        <endTime>2018-09-24-08:00</endTime>
        <workstation id="2">
          <workstationName> <![CDATA[Tool2]]></workstationName>
        </workstation>
        <barber id="3">
          <barberName><![CDATA[Merke Kass]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="1" available="true">
        <productName><![CDATA[Juukselõikus masinaga]]></productName>
        <price currency="€">30</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
</bookings>
</source>
=== XML Skeemifail ===
<source lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="bookings">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="booking">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="user">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="userName" type="xs:string" />
                    <xs:element name="userMail" type="xs:string" />
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:integer" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="schedules">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="schedule">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="startTime" type="xs:date" />
                          <xs:element name="endTime" type="xs:date" />
                          <xs:element name="workstation">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="workstationName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="barber">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="barberName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:integer" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="products">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="product">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="productName" type="xs:string" />
                          <xs:element name="price">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:integer">
                                  <xs:attribute name="currency" type="xs:string" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="productType">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="productTypeName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:integer" use="required" />
                        <xs:attribute name="available" type="xs:boolean" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:integer" use="required" />
            <xs:attribute name="totalCost" type="xs:decimal" use="required" />
            <xs:attribute name="vip" type="xs:boolean" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
</source>
=== XSLT 1 ===
<source lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <head>
        <title>Broneeringud</title>
      </head>
      <body>
        Broneeringud:
        <ol>
          <xsl:variable name="vip">true</xsl:variable>
          <xsl:for-each select="bookings/booking">
           
            <li>
              Klient: <xsl:if test="@vip = $vip">
                <b style="color:red;">VIP</b>
              </xsl:if><br/>
              <ul>
                Nimi: <xsl:value-of select="user/userName"/> <br/>
                Mail: <xsl:value-of select="user/userMail" />
              </ul>
              Broneeringu ajad:<br/>
              <ul>
                <xsl:for-each select="schedules/schedule">
                  Aeg: <xsl:value-of select="startTime" /> - <xsl:value-of select="endTime" /> <br/>
                  Pink: <xsl:value-of select="workstation/workstationName"/> <br/>
                  Juuksur: <xsl:value-of select="barber/barberName"/>
                </xsl:for-each>
              </ul>
              Teenused:<br/>
              <ul>
                <xsl:for-each select="products/product">
                  <xsl:sort select="@id" />
                  Teenus: <xsl:value-of select="productType/productTypeName"/><br/>
                  Täpsustus: <xsl:value-of select="productName" /> <br/>
                    Hind: <xsl:value-of select="price"/>
                  <br/>
                </xsl:for-each>
              </ul>
            </li>
            <br/>
          </xsl:for-each>
        </ol>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
</source>
=== XSLT 2 ===
<source lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <head>
        <title>Broneeringud</title>
      </head>
      <body>
        Broneeringud:
        <ol>
          <xsl:for-each select="bookings/booking">
            <xsl:sort select="@id" />
            <li>
              Klient:<br/>
              <ul>
                Nimi: <xsl:value-of select="user/userName"/> <br/>
                Mail: <xsl:value-of select="user/userMail" />
              </ul>
              Broneeringu ajad:<br/>
              <ul>
                <xsl:for-each select="schedules/schedule">
                  Aeg: <xsl:value-of select="startTime" /> - <xsl:value-of select="endTime" /> <br/>
                  Pink: <xsl:value-of select="workstation/workstationName"/> <br/>
                  Juuksur: <xsl:value-of select="barber/barberName"/>
                </xsl:for-each>
              </ul>
              Teenused:<br/>
              <ul>
                <xsl:for-each select="products/product">
                  <xsl:sort select="@id" />
                  Teenus: <xsl:value-of select="productType/productTypeName"/><br/>
                  Täpsustus: <xsl:value-of select="productName" /> <br/>
                  <xsl:choose>
                    <xsl:when test="price &lt;= 30">
                      <div style="color:red;">Hind:<xsl:value-of select="price"/></div>
                    </xsl:when>
                    <xsl:otherwise>
                      Hind: <xsl:value-of select="price"/>
                    </xsl:otherwise>
                  </xsl:choose>
                  <br/>
                </xsl:for-each>
              </ul>
            </li>
            <br/>
          </xsl:for-each>
        </ol>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
</source>

Latest revision as of 01:56, 9 May 2018

Meeskond

  • Kaido Henrik Elias
  • Arvo Paomees

Analüüs

Kirjeldus

HairSaloon on Eesti kõige modernsem ja kasutajasõbralikum barbershop e-teenus. Lehel on võimalik mugavalt broneerida juukselõikust, habemelõikust ja värvimist. Lisaks sellele on lehel olemas keelevalik.

Kasutajad

  • Admininstraator
  • Tavakasutaja

Infosüsteemi funktsionaalsus

Klient

  • Broneerida teenust
  • Valida teenuse osutamise kellaaja vastava juuksuri alt
  • Valida teenuse tüüpi ja valitud tüübile vastava töö

Juuksur/tavakasutaja

  • Võimalik näha töögraafikut
  • Võimalik näha broneeringuid

Juhataja/administraator

  • Hallata töögraafikuid
  • Hallata juuksureid
  • Hallata töökohti
  • Hallata teenuseid
  • Hallata produkte

Nice to have

  • Ühe broneeringuga saab valida mitut erinevat teenust -> done
  • Juuksurile tagasiside andmine
  • Broneeringu kinnituse saatmine juuksuri e-mailile
  • Broneeringu meeldetuletus kliendi e-mailile

Andmemudel

XML osa

XML Fail

<?xml version="1.0" encoding="utf-8" ?>
<bookings>
  <booking id="1" totalCost="60" vip="true">
    <user id="1">
      <userName><![CDATA[Mirk Peek]]></userName>
      <userMail><![CDATA[mirkpeek@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-06:00</startTime>
        <endTime>2018-09-24-07:00</endTime>
        <workstation id="1">
          <workstationName><![CDATA[Tool1]]></workstationName>
        </workstation>
        <barber id="1">
          <barberName><![CDATA[Sven Tüüp]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="1" available="true">
        <productName><![CDATA[Juukselõikus masinaga]]></productName>
        <price currency="€">30</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
      <product id ="2" available="true">
        <productName><![CDATA[Värvimine paksu värviga]]></productName>
        <price currency="€">30</price>
        <productType id="2">
          <productTypeName><![CDATA[Värvimine]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
   <booking id="3" totalCost="45" vip="false">
    <user id="3">
      <userName><![CDATA[Siim Vene]]></userName>
      <userMail><![CDATA[siimvene@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-09:00</startTime>
        <endTime>2018-09-24-10:00</endTime>
        <workstation id="2">
          <workstationName> <![CDATA[Tool1]]></workstationName>
        </workstation>
        <barber id="1">
          <barberName><![CDATA[Sven Tüüp]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="3" available="true">
        <productName><![CDATA[Juukselõikus masinag ja kääridega]]></productName>
        <price currency="€">40</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
  <booking id="2" totalCost="30" vip="false">
    <user id="2">
      <userName><![CDATA[Kenn Koolak]]></userName>
      <userMail><![CDATA[kennkoolak@gmail.com]]></userMail>
    </user>
    <schedules>
      <schedule id="1">
        <startTime>2018-09-24-07:00</startTime>
        <endTime>2018-09-24-08:00</endTime>
        <workstation id="2">
          <workstationName> <![CDATA[Tool2]]></workstationName>
        </workstation>
        <barber id="3">
          <barberName><![CDATA[Merke Kass]]></barberName>
        </barber>
      </schedule>
    </schedules>
    <products>
      <product id ="1" available="true">
        <productName><![CDATA[Juukselõikus masinaga]]></productName>
        <price currency="€">30</price>
        <productType id="1">
          <productTypeName><![CDATA[Juukselõikus]]></productTypeName>
        </productType>
      </product>
    </products>
  </booking>
</bookings>

XML Skeemifail

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="bookings">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="booking">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="user">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="userName" type="xs:string" />
                    <xs:element name="userMail" type="xs:string" />
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:integer" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="schedules">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="schedule">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="startTime" type="xs:date" />
                          <xs:element name="endTime" type="xs:date" />
                          <xs:element name="workstation">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="workstationName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="barber">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="barberName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:integer" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="products">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="product">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="productName" type="xs:string" />
                          <xs:element name="price">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:integer">
                                  <xs:attribute name="currency" type="xs:string" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="productType">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="productTypeName" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="id" type="xs:integer" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:integer" use="required" />
                        <xs:attribute name="available" type="xs:boolean" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:integer" use="required" />
            <xs:attribute name="totalCost" type="xs:decimal" use="required" />
            <xs:attribute name="vip" type="xs:boolean" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XSLT 1

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <head>
        <title>Broneeringud</title>
      </head>
      <body>
        Broneeringud:
        <ol>
          <xsl:variable name="vip">true</xsl:variable>
          <xsl:for-each select="bookings/booking">
            
            <li>
              Klient: <xsl:if test="@vip = $vip">
                <b style="color:red;">VIP</b>
              </xsl:if><br/>
              <ul>
                Nimi: <xsl:value-of select="user/userName"/> <br/>
                Mail: <xsl:value-of select="user/userMail" />
              </ul>
              Broneeringu ajad:<br/>
              <ul>
                <xsl:for-each select="schedules/schedule">
                  Aeg: <xsl:value-of select="startTime" /> - <xsl:value-of select="endTime" /> <br/>
                  Pink: <xsl:value-of select="workstation/workstationName"/> <br/>
                  Juuksur: <xsl:value-of select="barber/barberName"/>
                </xsl:for-each>
              </ul>
              Teenused:<br/>
              <ul>
                <xsl:for-each select="products/product">

                  <xsl:sort select="@id" />
                  Teenus: <xsl:value-of select="productType/productTypeName"/><br/>
                  Täpsustus: <xsl:value-of select="productName" /> <br/>
                    Hind: <xsl:value-of select="price"/>
                   <br/>
                </xsl:for-each>
              </ul>
            </li>
            <br/>
          </xsl:for-each>
        </ol>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

XSLT 2

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <head>
        <title>Broneeringud</title>
      </head>
      <body>
        Broneeringud:
        <ol>
          <xsl:for-each select="bookings/booking">
            <xsl:sort select="@id" />
            <li>
              Klient:<br/>
              <ul>
                Nimi: <xsl:value-of select="user/userName"/> <br/>
                Mail: <xsl:value-of select="user/userMail" />
              </ul>
              Broneeringu ajad:<br/>
              <ul>
                <xsl:for-each select="schedules/schedule">
                  Aeg: <xsl:value-of select="startTime" /> - <xsl:value-of select="endTime" /> <br/>
                  Pink: <xsl:value-of select="workstation/workstationName"/> <br/>
                  Juuksur: <xsl:value-of select="barber/barberName"/>
                </xsl:for-each>
              </ul>
              Teenused:<br/>
              <ul>
                <xsl:for-each select="products/product">

                  <xsl:sort select="@id" />
                  Teenus: <xsl:value-of select="productType/productTypeName"/><br/>
                  Täpsustus: <xsl:value-of select="productName" /> <br/>
                  <xsl:choose>
                    <xsl:when test="price &lt;= 30">
                      <div style="color:red;">Hind:<xsl:value-of select="price"/></div>
                    </xsl:when>
                    <xsl:otherwise>
                      Hind: <xsl:value-of select="price"/>
                    </xsl:otherwise>
                  </xsl:choose>
                  <br/>
                </xsl:for-each>
              </ul>
            </li>
            <br/>
          </xsl:for-each>
        </ol>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>