00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef Promotion_HPP
00012 #define Promotion_HPP
00013
00014 #include "read_write_base.hpp"
00015 #include <uuid/uuid.h>
00016
00017
00018 class Promotion_Obj: public read_write_base
00019 {
00020 public:
00021 identifier Id;
00022 string Name;
00023 string Description;
00024 string UUID;
00025 double Percent_Discount;
00026 bool Free_Shipping;
00027 double Percent_Commission;
00028 Promotion_Obj():read_write_base()
00029 ,Id(0LL)
00030 ,Name("")
00031 ,Description("")
00032 ,UUID("")
00033 ,Percent_Discount(0.0)
00034 ,Free_Shipping(false)
00035 ,Percent_Commission(0.0)
00036 {
00037 makeUUID();
00038
00039 data_name("Promotion");
00040
00041 addDXMap( new llongXfer("Id", &Id ));
00042 addDXMap( new stringXfer("Name", &Name ));
00043 addDXMap( new stringXfer("Description", &Description ));
00044 addDXMap( new stringXfer("UUID", &UUID ));
00045 addDXMap( new doubleXfer("Percent_Discount", &Percent_Discount ));
00046 addDXMap( new boolXfer("Free_Shipping", &Free_Shipping ));
00047 addDXMap( new doubleXfer("Percent_Commission", &Percent_Commission ));
00048 }
00049 void makeUUID(void)
00050 {
00051 uuid_t uuid;
00052 char uuid_val[37];
00053 memset(uuid,'\0',sizeof(uuid));
00054 uuid_generate(uuid);
00055 uuid_unparse(uuid, uuid_val);
00056 ocString uuid_work(uuid_val);
00057 UUID = uuid_work.replaceAll("-","");
00058 }
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 };
00074 #endif
00075
00076
00077