tx · Gyc3o4JPaBo57QNQWiNCY8LzjcbHH5pvWSHgUD4yWqha 3N61Xs9cTetvoP1uZSrtuRxxJ4A4RCR7a4G: -0.06000000 Waves 2020.11.26 16:28 [1282454] smart account 3N61Xs9cTetvoP1uZSrtuRxxJ4A4RCR7a4G > SELF 0.00000000 Waves
{ "type": 13, "id": "Gyc3o4JPaBo57QNQWiNCY8LzjcbHH5pvWSHgUD4yWqha", "fee": 6000000, "feeAssetId": null, "timestamp": 1606397304295, "version": 2, "chainId": 84, "sender": "3N61Xs9cTetvoP1uZSrtuRxxJ4A4RCR7a4G", "senderPublicKey": "DjYkFAzpGaY6gNruMz81SkVbRsemgpfr6KJbXXgyH3UM", "proofs": [ "5sQPUEbvL4HVh6qPerRbSJRBucmQqGK3yZQGQMikHsUn3C9BaxNgYLZPKBMTine39U8fwrnb94kRT2Z4WzMWti4B" ], "script": "base64:AAIEAAAAAAAAAC8IAhIECgIICBIECgIICBIHCgUIAQgICBIFCgMICAgSBAoCCAgSBAoCCAgSAwoBCAAAABgAAAAABE5PTkUCAAAABE5PTkUBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD2dldEJvb2xlYW5CeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQEAAAAPZ2V0SW50ZWdlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAA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xlcklkZW50aWZpY2F0aW9uBQAAAA5jb3VyaWVyQWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAWZ2V0S2V5T3JkZXJJc0RlbGl2ZXJlZAAAAAMFAAAABW9yZGVyBQAAABZyZXRhaWxlcklkZW50aWZpY2F0aW9uAgAAAAAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAFmdldEtleU9yZGVySXNEZWxpdmVyZWQAAAADBQAAAAVvcmRlcgUAAAAWcmV0YWlsZXJJZGVudGlmaWNhdGlvbgUAAAAOY291cmllckFkZHJlc3MFAAAACW9yZGVyRGF0YQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAA5jb3VyaWVyQWRkcmVzcwUAAAAIc2hpcHBpbmcFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAADa2V5CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXl0N/D2", "height": 1282454, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Exo8PB22f9AnwJSjjA2gswx37ocx14AcXPjea4kDT3rL Next: 2gFT2F1bizqbB52qBQohof257JkWhKPuJ8mba6u2yBqc Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "NONE" | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | - | func getKeyOrder ( | |
31 | - | let | |
32 | - | ("order_" + toBase58String(sha256(toBytes( | |
30 | + | func getKeyOrder (retailerIdentification,orderId) = { | |
31 | + | let retailerIdentificationAndOrderId = (retailerIdentification + orderId) | |
32 | + | ("order_" + toBase58String(sha256(toBytes(retailerIdentificationAndOrderId)))) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | - | func | |
36 | + | func getKeyRetailer (retailerIdentification) = ("retailer_" + toBase58String(sha256(toBytes(retailerIdentification)))) | |
37 | 37 | ||
38 | 38 | ||
39 | - | func | |
39 | + | func getKeyCourier (courierIdentification) = ("courier_" + toBase58String(sha256(toBytes(courierIdentification)))) | |
40 | 40 | ||
41 | 41 | ||
42 | - | func | |
42 | + | func getKeyOrderRetailerIdentification (order) = (order + "_retailer") | |
43 | 43 | ||
44 | 44 | ||
45 | - | func | |
45 | + | func getKeyOrderShippingCosts (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_shipping") | |
46 | 46 | ||
47 | 47 | ||
48 | - | func | |
48 | + | func getKeyOrderCourier (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_courierId") | |
49 | 49 | ||
50 | 50 | ||
51 | - | func | |
51 | + | func getKeyOrderIsAccepted (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) | |
52 | 52 | ||
53 | 53 | ||
54 | - | func | |
54 | + | func getKeyOrderIsInDelivery (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_isInDelivery") | |
55 | 55 | ||
56 | 56 | ||
57 | - | func | |
57 | + | func getKeyOrderDataOpen (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_data_open") | |
58 | 58 | ||
59 | 59 | ||
60 | - | func | |
60 | + | func getKeyOrderIsDelivered (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_isDelivered_") + courierAddress) | |
61 | 61 | ||
62 | 62 | ||
63 | - | func | |
63 | + | func getKeyRetailerData (retailer) = (retailer + "_data") | |
64 | 64 | ||
65 | 65 | ||
66 | - | func | |
66 | + | func getKeyCourierData (courier) = (courier + "_data") | |
67 | 67 | ||
68 | 68 | ||
69 | - | func getValueShippingCostsOfOrder (order) = getIntegerByKey(getKeyOrderShippingCosts(order)) | |
69 | + | func getValueRetailerIdentificationOfOrder (order) = getStringByKey(getKeyOrderRetailerIdentification(order)) | |
70 | + | ||
71 | + | ||
72 | + | func getValueIsAcceptedOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)) | |
73 | + | ||
74 | + | ||
75 | + | func getValueCourierIdOfOrder (order,retailerIdentification) = getStringByKey(getKeyOrderCourier(order, retailerIdentification)) | |
76 | + | ||
77 | + | ||
78 | + | func getValueIsInDeliveryOfOrder (order,retailerIdentification) = getBooleanByKey(getKeyOrderIsInDelivery(order, retailerIdentification)) | |
79 | + | ||
80 | + | ||
81 | + | func getValueIsDeliveredOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress)) | |
82 | + | ||
83 | + | ||
84 | + | func getValueShippingCostsOfOrder (order,retailerIdentification) = getIntegerByKey(getKeyOrderShippingCosts(order, retailerIdentification)) | |
85 | + | ||
86 | + | ||
87 | + | func getValueDataOfOrderOpen (order,retailerIdentification) = getStringByKey(getKeyOrderDataOpen(order, retailerIdentification)) | |
88 | + | ||
89 | + | ||
90 | + | func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer)) | |
70 | 91 | ||
71 | 92 | ||
72 | 93 | @Callable(i) | |
73 | - | func addOrder (orderId) = { | |
74 | - | let shopAddress = toBase58String(i.caller.bytes) | |
75 | - | let pmt = extract(i.payment) | |
76 | - | let shippingCosts = pmt.amount | |
77 | - | if (isDefined(pmt.assetId)) | |
78 | - | then throw("Currently you can place orders only with Waves tokens") | |
79 | - | else { | |
80 | - | let order = getKeyOrder(shopAddress, orderId) | |
81 | - | if ((0 >= shippingCosts)) | |
82 | - | then throw("You cannot create an order with shipping costs lower than 0") | |
83 | - | else if ((getValueShopAddressOfOrder(order) != NONE)) | |
84 | - | then throw("An order with the same id already exists") | |
85 | - | else WriteSet([DataEntry(getKeyOrderShopAddress(order), shopAddress), DataEntry(getKeyOrderShippingCosts(order), shippingCosts), DataEntry(getKeyOrderOrderId(order), orderId), DataEntry(getKeyOrderCourier(order), NONE), DataEntry(getKeyOrderIsAccepted(order), false), DataEntry(getKeyOrderIsInDelivery(order), false), DataEntry(getKeyOrderIsDelivered(order), false)]) | |
86 | - | } | |
94 | + | func registerRetailer (retailerIdentification,retailerData) = { | |
95 | + | let retailer = getKeyRetailer(retailerIdentification) | |
96 | + | [StringEntry(getKeyRetailerData(retailer), retailerData)] | |
87 | 97 | } | |
88 | 98 | ||
89 | 99 | ||
90 | 100 | ||
91 | 101 | @Callable(i) | |
92 | - | func setOrderIsAccepted (shopAddress,orderId) = { | |
93 | - | let order = getKeyOrder(shopAddress, orderId) | |
94 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
95 | - | then throw("The requested order does not exist") | |
96 | - | else if ((getValueIsAccepteOfOrder(order) != false)) | |
97 | - | then throw("The requested order is no longer available") | |
98 | - | else WriteSet([DataEntry(getKeyOrderIsAccepted(order), true)]) | |
102 | + | func registerCourier (courierIdentification,courierData) = { | |
103 | + | let courier = getKeyCourier(courierIdentification) | |
104 | + | [StringEntry(getKeyCourierData(courier), courierData)] | |
99 | 105 | } | |
100 | 106 | ||
101 | 107 | ||
102 | 108 | ||
103 | 109 | @Callable(i) | |
104 | - | func setOrderIsInDelivery (shopAddress,orderId) = { | |
105 | - | let order = getKeyOrder(shopAddress, orderId) | |
106 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
107 | - | then throw("The requested order does not exist") | |
108 | - | else if ((getValueIsInDeliveryOfOrder(order) != false)) | |
109 | - | then throw("The requested order is no longer available") | |
110 | - | else WriteSet([DataEntry(getKeyOrderIsInDelivery(order), true)]) | |
110 | + | func addOrder (orderId,shippingCosts,orderData,retailerIdentification,retailerData) = { | |
111 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
112 | + | let retailer = getKeyRetailer(retailerIdentification) | |
113 | + | let shipping = (shippingCosts * 100000000) | |
114 | + | if ((0 >= shippingCosts)) | |
115 | + | then throw("You cannot create an order with shipping costs lower than 0") | |
116 | + | else if ((getValueRetailerIdentificationOfOrder(order) != NONE)) | |
117 | + | then throw("An order with the same id already exists") | |
118 | + | else [StringEntry(getKeyRetailerData(retailer), retailerData), StringEntry(getKeyOrderRetailerIdentification(order), retailerIdentification), IntegerEntry(getKeyOrderShippingCosts(order, retailerIdentification), shipping), StringEntry(getKeyOrderDataOpen(order, retailerIdentification), orderData), StringEntry(getKeyOrderCourier(order, retailerIdentification), NONE), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), NONE), StringEntry(getKeyOrderIsInDelivery(order, retailerIdentification), NONE), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, ""), NONE)] | |
111 | 119 | } | |
112 | 120 | ||
113 | 121 | ||
114 | 122 | ||
115 | 123 | @Callable(i) | |
116 | - | func setOrderIsDelivered (shopAddress,orderId) = { | |
117 | - | let order = getKeyOrder(shopAddress, orderId) | |
118 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
124 | + | func setOrderIsAccepted (retailerIdentification,orderId,courierAddress) = { | |
125 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
126 | + | let orderData = getValueDataOfOrderOpen(order, retailerIdentification) | |
127 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
119 | 128 | then throw("The requested order does not exist") | |
120 | - | else if (( | |
129 | + | else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
121 | 130 | then throw("The requested order is no longer available") | |
122 | - | else | |
131 | + | else [DeleteEntry(getKeyOrderDataOpen(order, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress), orderData), StringEntry(getKeyOrderCourier(order, retailerIdentification), courierAddress)] | |
123 | 132 | } | |
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | @Callable(i) | |
137 | + | func setOrderIsInDelivery (retailerIdentification,orderId) = { | |
138 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
139 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
140 | + | then throw("The requested order does not exist") | |
141 | + | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification) != NONE)) | |
142 | + | then throw("The requested order is no longer available") | |
143 | + | else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification), true)] | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | @Callable(i) | |
149 | + | func setOrderIsDelivered (retailerIdentification,orderId) = { | |
150 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
151 | + | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
152 | + | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
153 | + | let shipping = getValueShippingCostsOfOrder(order, retailerIdentification) | |
154 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
155 | + | then throw("The requested order does not exist") | |
156 | + | else if ((courierAddress == NONE)) | |
157 | + | then throw("There was no courier set! Something went wrong with the order.") | |
158 | + | else if ((getValueIsDeliveredOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
159 | + | then throw("The requested order is no longer available") | |
160 | + | else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderIsDelivered(order, retailerIdentification, "")), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), orderData), ScriptTransfer(addressFromStringValue(courierAddress), shipping, unit)] | |
161 | + | } | |
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | @Callable(i) | |
166 | + | func deleteEntry (key) = [DeleteEntry(key)] | |
124 | 167 | ||
125 | 168 | ||
126 | 169 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "NONE" | |
5 | 5 | ||
6 | 6 | func getStringByKey (key) = match getString(this, key) { | |
7 | 7 | case a: String => | |
8 | 8 | a | |
9 | 9 | case _ => | |
10 | 10 | NONE | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getBooleanByKey (key) = match getBoolean(this, key) { | |
15 | 15 | case a: Boolean => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | NONE | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getIntegerByKey (key) = match getInteger(this, key) { | |
23 | 23 | case a: Int => | |
24 | 24 | a | |
25 | 25 | case _ => | |
26 | 26 | -1 | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | - | func getKeyOrder ( | |
31 | - | let | |
32 | - | ("order_" + toBase58String(sha256(toBytes( | |
30 | + | func getKeyOrder (retailerIdentification,orderId) = { | |
31 | + | let retailerIdentificationAndOrderId = (retailerIdentification + orderId) | |
32 | + | ("order_" + toBase58String(sha256(toBytes(retailerIdentificationAndOrderId)))) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | - | func | |
36 | + | func getKeyRetailer (retailerIdentification) = ("retailer_" + toBase58String(sha256(toBytes(retailerIdentification)))) | |
37 | 37 | ||
38 | 38 | ||
39 | - | func | |
39 | + | func getKeyCourier (courierIdentification) = ("courier_" + toBase58String(sha256(toBytes(courierIdentification)))) | |
40 | 40 | ||
41 | 41 | ||
42 | - | func | |
42 | + | func getKeyOrderRetailerIdentification (order) = (order + "_retailer") | |
43 | 43 | ||
44 | 44 | ||
45 | - | func | |
45 | + | func getKeyOrderShippingCosts (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_shipping") | |
46 | 46 | ||
47 | 47 | ||
48 | - | func | |
48 | + | func getKeyOrderCourier (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_courierId") | |
49 | 49 | ||
50 | 50 | ||
51 | - | func | |
51 | + | func getKeyOrderIsAccepted (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) | |
52 | 52 | ||
53 | 53 | ||
54 | - | func | |
54 | + | func getKeyOrderIsInDelivery (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_isInDelivery") | |
55 | 55 | ||
56 | 56 | ||
57 | - | func | |
57 | + | func getKeyOrderDataOpen (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_data_open") | |
58 | 58 | ||
59 | 59 | ||
60 | - | func | |
60 | + | func getKeyOrderIsDelivered (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_isDelivered_") + courierAddress) | |
61 | 61 | ||
62 | 62 | ||
63 | - | func | |
63 | + | func getKeyRetailerData (retailer) = (retailer + "_data") | |
64 | 64 | ||
65 | 65 | ||
66 | - | func | |
66 | + | func getKeyCourierData (courier) = (courier + "_data") | |
67 | 67 | ||
68 | 68 | ||
69 | - | func getValueShippingCostsOfOrder (order) = getIntegerByKey(getKeyOrderShippingCosts(order)) | |
69 | + | func getValueRetailerIdentificationOfOrder (order) = getStringByKey(getKeyOrderRetailerIdentification(order)) | |
70 | + | ||
71 | + | ||
72 | + | func getValueIsAcceptedOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)) | |
73 | + | ||
74 | + | ||
75 | + | func getValueCourierIdOfOrder (order,retailerIdentification) = getStringByKey(getKeyOrderCourier(order, retailerIdentification)) | |
76 | + | ||
77 | + | ||
78 | + | func getValueIsInDeliveryOfOrder (order,retailerIdentification) = getBooleanByKey(getKeyOrderIsInDelivery(order, retailerIdentification)) | |
79 | + | ||
80 | + | ||
81 | + | func getValueIsDeliveredOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress)) | |
82 | + | ||
83 | + | ||
84 | + | func getValueShippingCostsOfOrder (order,retailerIdentification) = getIntegerByKey(getKeyOrderShippingCosts(order, retailerIdentification)) | |
85 | + | ||
86 | + | ||
87 | + | func getValueDataOfOrderOpen (order,retailerIdentification) = getStringByKey(getKeyOrderDataOpen(order, retailerIdentification)) | |
88 | + | ||
89 | + | ||
90 | + | func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer)) | |
70 | 91 | ||
71 | 92 | ||
72 | 93 | @Callable(i) | |
73 | - | func addOrder (orderId) = { | |
74 | - | let shopAddress = toBase58String(i.caller.bytes) | |
75 | - | let pmt = extract(i.payment) | |
76 | - | let shippingCosts = pmt.amount | |
77 | - | if (isDefined(pmt.assetId)) | |
78 | - | then throw("Currently you can place orders only with Waves tokens") | |
79 | - | else { | |
80 | - | let order = getKeyOrder(shopAddress, orderId) | |
81 | - | if ((0 >= shippingCosts)) | |
82 | - | then throw("You cannot create an order with shipping costs lower than 0") | |
83 | - | else if ((getValueShopAddressOfOrder(order) != NONE)) | |
84 | - | then throw("An order with the same id already exists") | |
85 | - | else WriteSet([DataEntry(getKeyOrderShopAddress(order), shopAddress), DataEntry(getKeyOrderShippingCosts(order), shippingCosts), DataEntry(getKeyOrderOrderId(order), orderId), DataEntry(getKeyOrderCourier(order), NONE), DataEntry(getKeyOrderIsAccepted(order), false), DataEntry(getKeyOrderIsInDelivery(order), false), DataEntry(getKeyOrderIsDelivered(order), false)]) | |
86 | - | } | |
94 | + | func registerRetailer (retailerIdentification,retailerData) = { | |
95 | + | let retailer = getKeyRetailer(retailerIdentification) | |
96 | + | [StringEntry(getKeyRetailerData(retailer), retailerData)] | |
87 | 97 | } | |
88 | 98 | ||
89 | 99 | ||
90 | 100 | ||
91 | 101 | @Callable(i) | |
92 | - | func setOrderIsAccepted (shopAddress,orderId) = { | |
93 | - | let order = getKeyOrder(shopAddress, orderId) | |
94 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
95 | - | then throw("The requested order does not exist") | |
96 | - | else if ((getValueIsAccepteOfOrder(order) != false)) | |
97 | - | then throw("The requested order is no longer available") | |
98 | - | else WriteSet([DataEntry(getKeyOrderIsAccepted(order), true)]) | |
102 | + | func registerCourier (courierIdentification,courierData) = { | |
103 | + | let courier = getKeyCourier(courierIdentification) | |
104 | + | [StringEntry(getKeyCourierData(courier), courierData)] | |
99 | 105 | } | |
100 | 106 | ||
101 | 107 | ||
102 | 108 | ||
103 | 109 | @Callable(i) | |
104 | - | func setOrderIsInDelivery (shopAddress,orderId) = { | |
105 | - | let order = getKeyOrder(shopAddress, orderId) | |
106 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
107 | - | then throw("The requested order does not exist") | |
108 | - | else if ((getValueIsInDeliveryOfOrder(order) != false)) | |
109 | - | then throw("The requested order is no longer available") | |
110 | - | else WriteSet([DataEntry(getKeyOrderIsInDelivery(order), true)]) | |
110 | + | func addOrder (orderId,shippingCosts,orderData,retailerIdentification,retailerData) = { | |
111 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
112 | + | let retailer = getKeyRetailer(retailerIdentification) | |
113 | + | let shipping = (shippingCosts * 100000000) | |
114 | + | if ((0 >= shippingCosts)) | |
115 | + | then throw("You cannot create an order with shipping costs lower than 0") | |
116 | + | else if ((getValueRetailerIdentificationOfOrder(order) != NONE)) | |
117 | + | then throw("An order with the same id already exists") | |
118 | + | else [StringEntry(getKeyRetailerData(retailer), retailerData), StringEntry(getKeyOrderRetailerIdentification(order), retailerIdentification), IntegerEntry(getKeyOrderShippingCosts(order, retailerIdentification), shipping), StringEntry(getKeyOrderDataOpen(order, retailerIdentification), orderData), StringEntry(getKeyOrderCourier(order, retailerIdentification), NONE), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), NONE), StringEntry(getKeyOrderIsInDelivery(order, retailerIdentification), NONE), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, ""), NONE)] | |
111 | 119 | } | |
112 | 120 | ||
113 | 121 | ||
114 | 122 | ||
115 | 123 | @Callable(i) | |
116 | - | func setOrderIsDelivered (shopAddress,orderId) = { | |
117 | - | let order = getKeyOrder(shopAddress, orderId) | |
118 | - | if ((getValueShopAddressOfOrder(order) != shopAddress)) | |
124 | + | func setOrderIsAccepted (retailerIdentification,orderId,courierAddress) = { | |
125 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
126 | + | let orderData = getValueDataOfOrderOpen(order, retailerIdentification) | |
127 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
119 | 128 | then throw("The requested order does not exist") | |
120 | - | else if (( | |
129 | + | else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
121 | 130 | then throw("The requested order is no longer available") | |
122 | - | else | |
131 | + | else [DeleteEntry(getKeyOrderDataOpen(order, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress), orderData), StringEntry(getKeyOrderCourier(order, retailerIdentification), courierAddress)] | |
123 | 132 | } | |
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | @Callable(i) | |
137 | + | func setOrderIsInDelivery (retailerIdentification,orderId) = { | |
138 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
139 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
140 | + | then throw("The requested order does not exist") | |
141 | + | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification) != NONE)) | |
142 | + | then throw("The requested order is no longer available") | |
143 | + | else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification), true)] | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | @Callable(i) | |
149 | + | func setOrderIsDelivered (retailerIdentification,orderId) = { | |
150 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
151 | + | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
152 | + | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
153 | + | let shipping = getValueShippingCostsOfOrder(order, retailerIdentification) | |
154 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
155 | + | then throw("The requested order does not exist") | |
156 | + | else if ((courierAddress == NONE)) | |
157 | + | then throw("There was no courier set! Something went wrong with the order.") | |
158 | + | else if ((getValueIsDeliveredOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
159 | + | then throw("The requested order is no longer available") | |
160 | + | else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderIsDelivered(order, retailerIdentification, "")), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), orderData), ScriptTransfer(addressFromStringValue(courierAddress), shipping, unit)] | |
161 | + | } | |
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | @Callable(i) | |
166 | + | func deleteEntry (key) = [DeleteEntry(key)] | |
124 | 167 | ||
125 | 168 | ||
126 | 169 | @Verifier(tx) | |
127 | 170 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
128 | 171 |
github/deemru/w8io/169f3d6 59.17 ms ◑![]()