Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data class Receipt(
val emailTo: String? = null,
val closing: Long? = null,
val additionalText: String? = null,
val webSecret: String? = null,
) {
enum class PaymentType(val value: String) {
CASH("cash"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ fun Receipt.toModel() =
invoiceNameParts = invoice_name_parts,
orderEmail = order_email,
orderPhone = order_phone,
webSecret = websecret,
)
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fun Receipt.toJSON(): JSONObject {
jo.put("cashier", cashier_numericid)
jo.put("training", training)
jo.put("additional_text", additional_text)
jo.put("web_secret", if (websecret != null) websecret else JSONObject.NULL)

// the following columns are not persisted on the server,
// but only used locally to act as holders of data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ INSERT INTO Receipt (
printed,
server_id,
started,
training
training,
websecret
)
VALUES (
?,
Expand Down Expand Up @@ -67,9 +68,10 @@ VALUES (
?,
?,
?,
?,
?
);

);
updateOrderCode:
UPDATE Receipt
SET
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE Receipt ADD COLUMN websecret TEXT;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ CREATE TABLE Receipt (
server_id bigint,
started boolean DEFAULT FALSE,
training boolean DEFAULT FALSE NOT NULL,
closing bigint REFERENCES Closing (id) ON DELETE CASCADE
closing bigint REFERENCES Closing (id) ON DELETE CASCADE,
websecret character varying(255)
);

CREATE INDEX Receipt_closing_index ON Receipt (closing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ CREATE TABLE Receipt (
printed INTEGER AS Boolean DEFAULT 0 NOT NULL,
server_id INTEGER,
started INTEGER AS Boolean DEFAULT 0,
training INTEGER AS Boolean DEFAULT 0 NOT NULL
training INTEGER AS Boolean DEFAULT 0 NOT NULL,
websecret TEXT
);

CREATE INDEX Receipt_closing_index ON Receipt (closing);
Expand Down
Loading