diff --git a/groupTasks/groups/shx-order/backPage.html b/groupTasks/groups/shx-order/backPage.html new file mode 100644 index 0000000..7553e1a --- /dev/null +++ b/groupTasks/groups/shx-order/backPage.html @@ -0,0 +1,162 @@ + + + + + + Document + + + + + + + +
+ +
+
+
+
+ +
+

10 % auf Alles

+ + +
+ +
+
+ +
+
+ Freigeschaltet +
+
+
+ +

+ Bewerte dein gekauftes Produkt in unserem Shop und erhalte einen + Gutschein in Höhe von 5 €! +

+

+ Scanne den QR Code, um zu bewerten. +

+ +
+ SYfwa2g +
+
+ +
+
+ +
+

5 € auf Alles

+ + +
+ +
+ + +
+
+ Freischaltbar +
+
+ Dauer: 5 Minuten* +
+
+
+ +

+ Bewerte dein gekauftes Produkt in unserem Shop und erhalte einen + Gutschein in Höhe von 5 €! +

+

Scanne den QR Code, um zu bewerten.

+ +
+ Mindestbestellwert beträgt 20 € +
+ +
+ ******** +
+
+ +
+
+ +
+

10 € auf Alles

+ + +
+ +
+ + +
+
+ Freischaltbar +
+
+ Dauer: 5 Minuten* +
+
+
+ +

+ Bewerte dein gekauftes Produkt in unserem Shop und erhalte einen + Gutschein in Höhe von 10 €! +

+

Scanne den QR Code, um zu bewerten.

+ +
+ Mindestbestellwert beträgt 20 € +
+ +
+ ******** +
+
+
+
+ + diff --git a/groupTasks/groups/shx-order/backPage3.html b/groupTasks/groups/shx-order/backPage3.html new file mode 100644 index 0000000..cb16de0 --- /dev/null +++ b/groupTasks/groups/shx-order/backPage3.html @@ -0,0 +1,94 @@ + + + + + + + + + + + +
+
+
+ + +
+

GUTSCHEINE

+
+
+
+
+
+
+
+

+ + 5 € + auf Alles + +

+
Freischaltbar
+ +
+
+
+
Dauer: 5 Minuten*
+
+
+
+ + +
+ +
+
+

+ Bewerte dein gekauftes Produkt in unserem Shop und erhalte + einen Gutschein in Höhe von 5 €! +

+

 

+

+ Scanne den QR Code, um zu bewerten. +

+
+
+
+
+
+ Mindestbestellwert beträgt 20 € +
+
+
+

********

+
+
+
+
+
+
+ +
+
+ + diff --git a/groupTasks/groups/shx-order/backPageLogo.svg b/groupTasks/groups/shx-order/backPageLogo.svg new file mode 100644 index 0000000..80353f1 --- /dev/null +++ b/groupTasks/groups/shx-order/backPageLogo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/groupTasks/groups/shx-order/background.png b/groupTasks/groups/shx-order/background.png new file mode 100644 index 0000000..c8c2571 Binary files /dev/null and b/groupTasks/groups/shx-order/background.png differ diff --git a/groupTasks/groups/shx-order/background.svg b/groupTasks/groups/shx-order/background.svg new file mode 100644 index 0000000..06986bb --- /dev/null +++ b/groupTasks/groups/shx-order/background.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/groupTasks/groups/shx-order/crmCustomer.py b/groupTasks/groups/shx-order/crmCustomer.py new file mode 100644 index 0000000..e08bfa4 --- /dev/null +++ b/groupTasks/groups/shx-order/crmCustomer.py @@ -0,0 +1,103 @@ +import requests +import sys +import json + +# DEFINITIONS + +endpoint_url = "https://devdash.ex.umbach.dev/api/v1/crm" +api_key = "uY1DTUog-Iax7-ydc4-dP9V-NON1xsbTGH1I" + +headers = { + "X-Api-Key": api_key, + "Content-Type": "application/json" +} + +# MAIN + +json_object = json.loads(sys.argv[1]) +customerEmail = json_object["customerEmail"] +orderId = json_object["orderId"] + +if customerEmail is None: + print("customerEmail is required") + sys.exit(1) + +customerEmail = customerEmail["value"] +orderId = orderId["value"] + + +def CreateCrmCustomer(): + response = requests.post( + url=f"{endpoint_url}/customer/create", + headers=headers, + json={ + "FirstName": "Shopify Customer", + "Email": customerEmail, + "LeadOrigin": "Shopify Customer added by GroupTask", + }) + + if response.status_code != 200: + print(f"CreateCrmCustomer req error {response.status_code}") + sys.exit(1) + + print(response.status_code) + print(response.json()) + + return response.json()["Id"] + + +def CheckIfCrmCustomerExists(): + print(f"Checking if customer exists: {customerEmail}") + + response = requests.post( + url=f"{endpoint_url}/customer", + headers=headers, + json={"Email": customerEmail} # Hier json verwenden, um JSON-Daten zu senden + ) + + print("CheckIfCrmCustomerExists response status code", response.status_code) + + if response.status_code != 200: + print(f"CheckIfCrmCustomerExists req error {response.status_code}") + sys.exit(1) + + customerId = "" + + if response.json() == []: + print("Customer not found") + customerId = CreateCrmCustomer() + else: + if len(response.json()) > 1: + print("Multiple customers found. Don't know which one to use") + sys.exit(1) + + customerId = response.json()[0]["Id"] + + CreateCrmActivityLink(customerId=customerId) + + +def CreateCrmActivityLink(customerId): + print(f"Creating CRM activity link for customer {customerId}") + + def req(type): + response = requests.post( + url=f"{endpoint_url}/links", + headers=headers, + json={ + "CustomerId": customerId, + "Name": f"Shopify Order #{orderId} - {type}", + "Url": "https://www.example.com" + }) + + if response.status_code != 200: + print(f"CreateCrmActivityLink req error {response.status_code}") + sys.exit(1) + + print(response.status_code) + + req("5 € Gutschein") + req("10 € Gutschein") + + + +CheckIfCrmCustomerExists() diff --git a/groupTasks/groups/shx-order/discounts.py b/groupTasks/groups/shx-order/discounts.py new file mode 100644 index 0000000..f882d69 --- /dev/null +++ b/groupTasks/groups/shx-order/discounts.py @@ -0,0 +1,94 @@ +import os +import pdfkit +import qrcode +import subprocess +import PyPDF2 + + +def create_pdf_from_html(html_file, pdf_file): + pdfkit.from_file(html_file, pdf_file, options={"page-size": "A5", "orientation": "Landscape", "enable-local-file-access": ""}) + + +def list_files_in_directory(directory): + files = os.listdir(directory) + for file in files: + print(file) + + +def create_qrcode(): + data = "https://www.example.com" + + # Generate QR code + qr = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=10, + border=4, + ) + qr.add_data(data) + qr.make(fit=True) + + # Create an image from the QR Code instance + img = qr.make_image(fill_color="black", back_color="#fdf8ef") + + # Save image to a file + img.save("./example_qr.png") + + # Display the generated QR code image + img.show() + +def test(sourceHtml, outputPdf): + command = [ + "google-chrome-stable", + "--headless", + "--no-sandbox", + "--disable-gpu", + "--debug=1", + "--print-to-pdf=" + outputPdf, + "--run-all-compositor-stages-before-draw", + "--virtual-time-budget=10000", + sourceHtml, + ] + + process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = process.communicate() + + print("STDOUT:", stdout) + print("STDERR:", stderr) + +def merge_pdfs(pdf1_path, pdf2_path, output_path): + # Öffne die beiden PDF-Dateien + with open(pdf1_path, 'rb') as file1, open(pdf2_path, 'rb') as file2: + # Erstelle PDF-Reader-Objekte + pdf1_reader = PyPDF2.PdfReader(file1) + pdf2_reader = PyPDF2.PdfReader(file2) + + # Erstelle PDF-Writer-Objekt + pdf_writer = PyPDF2.PdfWriter() + + # Füge Seiten aus der ersten PDF hinzu + for page_num in range(len(pdf1_reader.pages)): + page = pdf1_reader.pages[page_num] + pdf_writer.add_page(page) + + # Füge Seiten aus der zweiten PDF hinzu + for page_num in range(len(pdf2_reader.pages)): + page = pdf2_reader.pages[page_num] + pdf_writer.add_page(page) + + # Speichere die kombinierte PDF + with open(output_path, 'wb') as output_file: + pdf_writer.write(output_file) + +if __name__ == "__main__": + directory = "oldFiles/" # Aktuelles Verzeichnis + list_files_in_directory(directory) + + create_pdf_from_html("oldFiles/frontPage.html", "outputFront.pdf") + create_pdf_from_html("oldFiles/backPage.html", "outputBack.pdf") + create_pdf_from_html("oldFiles/backPage3.html", "outputBack3.pdf") + create_qrcode() + test("oldFiles/frontPage.html", "finalFrontPage.pdf") + test("oldFiles/backPage.html", "finalBackPage.pdf") + + merge_pdfs('finalFrontPage.pdf', 'finalBackPage.pdf', 'combined.pdf') \ No newline at end of file diff --git a/groupTasks/groups/shx-order/emojiGlasses.svg b/groupTasks/groups/shx-order/emojiGlasses.svg new file mode 100644 index 0000000..af3082a --- /dev/null +++ b/groupTasks/groups/shx-order/emojiGlasses.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/feeling.jpg b/groupTasks/groups/shx-order/feeling.jpg new file mode 100644 index 0000000..9c277d7 Binary files /dev/null and b/groupTasks/groups/shx-order/feeling.jpg differ diff --git a/groupTasks/groups/shx-order/frontPage.html b/groupTasks/groups/shx-order/frontPage.html new file mode 100644 index 0000000..e3e0f79 --- /dev/null +++ b/groupTasks/groups/shx-order/frontPage.html @@ -0,0 +1,112 @@ + + + + + + Document + + + + +
+ +
+ +
+ + Hey, wir haben gerade Dein Paket liebevoll verpackt und konnten es kaum + erwarten, Dir diese kleine Nachricht zu hinterlassen, + + [NAME]. +
+ +

+ Es ist dieses besondere Gefühl, zu wissen, dass unsere Produkte neue + Zuhause finden, das uns jeden Tag antreibt. Deine Entscheidung, bei uns zu + shoppen, macht uns überglücklich! Wir hoffen, dass Du beim Auspacken + genauso viel Freude empfindest, wie wir beim Verpacken. +

+ +
+ Um unsere Wertschätzung zu zeigen und Dir für Deine + Treue + zu danken, haben wir ein paar + Gutscheincodes + + für Dich zusammengestellt + + Mit diesen kannst Du bei Deinen nächsten Einkäufen ordentlich + sparen: +
+ + + +

+ Jeder Code ist ein kleines Dankeschön von uns an Dich, + [NAME], und wir hoffen, dass sie Dein Shopping-Erlebnis noch besser machen. + Falls Du Fragen hast oder Unterstützung brauchst, zögere nicht, uns zu + kontaktieren. +

+ +

+ Deine Unterstützung ermöglicht es uns, weiter zu wachsen und unsere + Gemeinschaft zu bereichern. Wir freuen uns darauf, Dich bald wieder + begrüßen zu dürfen und wünschen Dir viel + + Freude + mit allem, was Du bestellt hast! +

+ + Liebe Grüße +
+ dein Jan + + + diff --git a/groupTasks/groups/shx-order/frontPageBackground.svg b/groupTasks/groups/shx-order/frontPageBackground.svg new file mode 100644 index 0000000..06986bb --- /dev/null +++ b/groupTasks/groups/shx-order/frontPageBackground.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/groupTasks/groups/shx-order/frontPageLogo.svg b/groupTasks/groups/shx-order/frontPageLogo.svg new file mode 100644 index 0000000..f40a7cc --- /dev/null +++ b/groupTasks/groups/shx-order/frontPageLogo.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/groupTasks/groups/shx-order/glasses.png b/groupTasks/groups/shx-order/glasses.png new file mode 100644 index 0000000..9621699 Binary files /dev/null and b/groupTasks/groups/shx-order/glasses.png differ diff --git a/groupTasks/groups/shx-order/global.css b/groupTasks/groups/shx-order/global.css new file mode 100644 index 0000000..5fb947f --- /dev/null +++ b/groupTasks/groups/shx-order/global.css @@ -0,0 +1,56 @@ +body { + margin: 0; + line-height: normal; +} + +:root { + /* fonts */ + --font-outfit: Outfit; + + /* font sizes */ + --font-size-5xl: 24px; + --font-size-lgi: 19px; + --font-size-29xl: 48px; + --font-size-10xl: 29px; + --font-size-19xl: 38px; + --font-size-xl: 20px; + --font-size-base: 16px; + --font-size-13xl: 32px; + --font-size-7xl: 26px; + --font-size-45xl: 64px; + --font-size-32xl: 51px; + + /* Colors */ + --color-dimgray-100: #616161; + --color-floralwhite: #fdf8ef; + --color-tan: rgba(175, 147, 99, 0.1); + --color-darkslategray: #393939; + --color-black: #000; + --color-gray: rgba(0, 0, 0, 0.71); + --color-firebrick: #a80000; + + /* Gaps */ + --gap-10xl: 29px; + --gap-sm-5: 13.5px; + --gap-mini-5: 14.5px; + + /* Paddings */ + --padding-10xl: 29px; + --padding-78xl: 97px; + --padding-150xl: 169px; + --padding-lgi-5: 19.5px; + --padding-xl: 20px; + --padding-52xl: 71px; + --padding-91xl: 110px; + --padding-6xs: 7px; + --padding-5xs-5: 7.5px; + --padding-11xs: 2px; + --padding-mid: 17px; + --padding-20xl-5: 39.5px; + --padding-9xs: 4px; + --padding-5xs: 8px; + + /* Border radiuses */ + --br-xl: 20px; + --br-6xs: 7px; +} diff --git a/groupTasks/groups/shx-order/group-24-1.svg b/groupTasks/groups/shx-order/group-24-1.svg new file mode 100644 index 0000000..87bb3d3 --- /dev/null +++ b/groupTasks/groups/shx-order/group-24-1.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/groupTasks/groups/shx-order/icon_lock_closed.svg b/groupTasks/groups/shx-order/icon_lock_closed.svg new file mode 100644 index 0000000..b1c8602 --- /dev/null +++ b/groupTasks/groups/shx-order/icon_lock_closed.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/icon_lock_open.svg b/groupTasks/groups/shx-order/icon_lock_open.svg new file mode 100644 index 0000000..ae300c6 --- /dev/null +++ b/groupTasks/groups/shx-order/icon_lock_open.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/image-11@2x.png b/groupTasks/groups/shx-order/image-11@2x.png new file mode 100644 index 0000000..218a192 Binary files /dev/null and b/groupTasks/groups/shx-order/image-11@2x.png differ diff --git a/groupTasks/groups/shx-order/index.css b/groupTasks/groups/shx-order/index.css new file mode 100644 index 0000000..c1ab56f --- /dev/null +++ b/groupTasks/groups/shx-order/index.css @@ -0,0 +1,861 @@ +.redeem-fill1-wght300-grad0-ops-icon { + height: 142px; + width: 142px; + position: relative; + overflow: hidden; + flex-shrink: 0; +} +.gutscheine { + margin: 0; + position: relative; + font-size: inherit; + letter-spacing: 0.1em; + font-weight: 400; + font-family: inherit; +} +.receipt-icon { + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + padding: 10px 0 0; + box-sizing: border-box; + max-width: 100%; +} +.redeem-fill1-wght300-grad0-ops-parent, +.root-container-inner { + display: flex; + flex-direction: row; + align-items: flex-start; + max-width: 100%; +} +.redeem-fill1-wght300-grad0-ops-parent { + justify-content: flex-start; + gap: 58px; +} +.root-container-inner { + align-self: stretch; + justify-content: center; + padding: 0 0 0 var(--padding-9xs); + box-sizing: border-box; +} +.auf-alles { + margin: 0; + align-self: stretch; + height: 209px; + position: relative; + font-size: inherit; + letter-spacing: 0.1em; + display: flex; + align-items: center; + flex-shrink: 0; + z-index: 1; + font-family: inherit; +} +.locked-icon-child { + height: 100%; + width: 100%; + position: absolute; + margin: 0 !important; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: var(--br-6xs); + background-color: var(--color-tan); +} +.freigeschaltet { + height: 64px; + flex: 1; + position: relative; + letter-spacing: 0.1em; + display: flex; + align-items: center; + justify-content: center; + z-index: 2; +} +.locked-icon { + width: 277px; + margin: 0 !important; + position: absolute; + top: 149px; + left: 266px; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + text-align: center; + font-size: var(--font-size-13xl); + color: #0c620a; +} +.lock-open-fill1-wght300-grad0-icon { + width: 78px; + height: 78px; + position: absolute; + margin: 0 !important; + top: 61.5px; + right: 29px; + overflow: hidden; + flex-shrink: 0; + z-index: 2; +} +.product-name { + align-self: stretch; + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + padding: 0 0 var(--padding-9xs); + position: relative; +} +.group-24-1 { + height: 323px; + width: 395px; + position: absolute; + margin: 0 !important; + top: -73.5px; + left: 59px; + overflow: hidden; + flex-shrink: 0; +} +.auf-deinen-nchsten { + height: 289px; + flex: 1; + position: relative; + font-weight: 300; + display: inline-block; + max-width: 100%; + z-index: 1; +} +.next-shopping-step { + flex: 1; + flex-direction: row; + position: relative; + max-width: 100%; +} +.next-shopping-step, +.next-shopping-step-wrapper, +.shopping-cart-icon { + display: flex; + align-items: flex-start; + justify-content: flex-start; +} +.next-shopping-step-wrapper { + width: 558px; + flex-direction: row; + padding: 0 var(--padding-5xs); + box-sizing: border-box; + max-width: 100%; + font-size: var(--font-size-13xl); +} +.shopping-cart-icon { + margin-top: -670px; + width: 579px; + flex-direction: column; + gap: 113.5px; + flex-shrink: 0; + debug_commit: 1de1738; + max-width: 108%; +} +.frame-child, +.syfwa2g { + position: relative; + max-width: 100%; +} +.frame-child { + height: 104px; + width: 527px; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + display: none; +} +.syfwa2g { + margin: 0; + height: 100px; + flex: 1; + font-size: inherit; + letter-spacing: 0.29em; + font-weight: 300; + font-family: inherit; + display: flex; + align-items: center; + justify-content: center; + z-index: 1; +} +.frame-wrapper, +.rectangle-parent, +.shopping-cart-icon-parent { + flex-shrink: 0; + display: flex; + align-items: flex-start; + justify-content: flex-start; +} +.rectangle-parent { + flex: 1; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + flex-direction: row; + padding: var(--padding-11xs) var(--padding-mid); +} +.frame-wrapper, +.shopping-cart-icon-parent { + box-sizing: border-box; +} +.frame-wrapper { + align-self: stretch; + flex-direction: row; + padding: 0 0 0 var(--padding-5xs); + max-width: 100%; + text-align: center; + font-size: var(--font-size-29xl); + color: var(--color-darkslategray); +} +.shopping-cart-icon-parent { + height: 750px; + width: 591px; + border-radius: var(--br-xl); + background-color: var(--color-floralwhite); + overflow: hidden; + flex-direction: column; + padding: 626px 27px var(--padding-xl) var(--padding-10xl); + gap: 54.5px; +} +.auf-alles1, +.freischaltbar { + letter-spacing: 0.1em; + display: flex; + align-items: center; +} +.auf-alles1 { + margin: 0; + align-self: stretch; + height: 209px; + position: relative; + font-size: inherit; + flex-shrink: 0; + z-index: 1; + font-family: inherit; +} +.freischaltbar { + width: 277px; + height: 64px; + position: absolute; + margin: 0 !important; + right: 36px; + bottom: 0; + font-size: var(--font-size-13xl); + color: var(--color-firebrick); + text-align: center; + justify-content: center; + z-index: 2; +} +.lock-fill1-wght300-grad0-opsz2-icon { + width: 78px; + height: 78px; + position: absolute; + margin: 0 !important; + top: 62px; + right: 29px; + overflow: hidden; + flex-shrink: 0; + z-index: 2; +} +.auf-alles-parent, +.dauer-5-minuten { + position: relative; + display: flex; + flex-shrink: 0; +} +.auf-alles-parent { + margin-top: -213px; + width: 579px; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + padding: 0 0 var(--padding-9xs); + box-sizing: border-box; + debug_commit: 1de1738; +} +.dauer-5-minuten { + height: 62px; + width: 277px; + font-weight: 300; + align-items: center; + justify-content: center; + z-index: 1; +} +.dauer-5-minuten-wrapper { + align-self: stretch; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-end; + padding: 0 0 var(--padding-20xl-5); +} +.group-24-11 { + position: absolute; + top: 107px; + left: 90.5px; + width: 395px; + height: 323px; + overflow: hidden; +} +.frame-item { + position: absolute; + top: 3px; + left: 289.5px; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + width: 277px; + height: 64px; +} +.image-11-icon { + position: absolute; + top: 0; + left: 0; + width: 182px; + height: 182px; + object-fit: cover; + mix-blend-mode: multiply; + z-index: 2; +} +.group-24-1-parent { + height: 430px; + width: 566.5px; + position: absolute; + margin: 0 !important; + top: -182px; + left: -24px; +} +.bewerte-dein-gekauftes, +.blank-line, +.scanne-den-qr { + margin: 0; +} +.bewerte-dein-gekauftes-container { + height: 289px; + flex: 1; + position: relative; + font-weight: 300; + display: inline-block; + max-width: 100%; + z-index: 1; +} +.frame-parent1 { + align-self: stretch; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + position: relative; + max-width: 100%; + text-align: left; + font-size: var(--font-size-13xl); + color: var(--color-black); +} +.mindestbestellwert-betrgt-20 { + align-self: stretch; + position: relative; + font-weight: 300; +} +.frame-inner { + height: 104px; + width: 527px; + position: relative; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + display: none; + max-width: 100%; +} +.h3, +.rectangle-group { + display: flex; + max-width: 100%; +} +.h3 { + margin: 0; + height: 100px; + flex: 1; + position: relative; + font-size: inherit; + letter-spacing: 0.29em; + font-weight: 300; + font-family: inherit; + align-items: center; + justify-content: center; + z-index: 1; +} +.rectangle-group { + align-self: stretch; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + padding: var(--padding-11xs) var(--padding-mid); + box-sizing: border-box; + font-size: var(--font-size-29xl); + color: var(--color-darkslategray); +} +.separator { + flex: 1; + flex-direction: column; + gap: var(--gap-mini-5); + max-width: 100%; +} +.frame-container, +.frame-div, +.minimum-order-amount, +.separator { + display: flex; + align-items: flex-start; + justify-content: flex-start; +} +.minimum-order-amount { + align-self: stretch; + flex-direction: row; + padding: 0 var(--padding-6xs) 0 var(--padding-5xs-5); + box-sizing: border-box; + max-width: 100%; + font-size: var(--font-size-xl); + color: var(--color-dimgray-100); +} +.frame-container, +.frame-div { + flex-shrink: 0; + flex-direction: column; +} +.frame-div { + align-self: stretch; + gap: var(--gap-sm-5); + debug_commit: 1de1738; + text-align: center; + font-size: var(--font-size-5xl); + color: var(--color-gray); +} +.frame-container { + height: 750px; + width: 591px; + border-radius: var(--br-xl); + background-color: var(--color-floralwhite); + overflow: hidden; + padding: var(--padding-150xl) var(--padding-lgi-5) var(--padding-xl) + var(--padding-10xl); + box-sizing: border-box; +} +.auf-alles2, +.freischaltbar1 { + letter-spacing: 0.1em; + display: flex; + align-items: center; +} +.auf-alles2 { + margin: 0; + align-self: stretch; + height: 209px; + position: relative; + font-size: inherit; + flex-shrink: 0; + z-index: 1; + font-family: inherit; +} +.freischaltbar1 { + width: 277px; + height: 64px; + position: absolute; + margin: 0 !important; + right: 36px; + bottom: 0; + font-size: var(--font-size-13xl); + color: var(--color-firebrick); + text-align: center; + justify-content: center; + z-index: 2; +} +.lock-fill1-wght300-grad0-opsz2-icon1 { + width: 78px; + height: 78px; + position: absolute; + margin: 0 !important; + top: 62px; + right: 29px; + overflow: hidden; + flex-shrink: 0; + z-index: 2; +} +.auf-alles-group, +.dauer-5-minuten1 { + position: relative; + display: flex; + flex-shrink: 0; +} +.auf-alles-group { + margin-top: -213px; + width: 579px; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + padding: 0 0 var(--padding-9xs); + box-sizing: border-box; + debug_commit: 1de1738; +} +.dauer-5-minuten1 { + height: 62px; + width: 277px; + font-weight: 300; + align-items: center; + justify-content: center; + z-index: 1; +} +.dauer-5-minuten-container { + align-self: stretch; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-end; + padding: 0 0 var(--padding-20xl-5); +} +.group-24-12 { + position: absolute; + top: 107px; + left: 90.5px; + width: 395px; + height: 323px; + overflow: hidden; +} +.rectangle-div { + position: absolute; + top: 3px; + left: 289.5px; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + width: 277px; + height: 64px; +} +.image-11-icon1 { + position: absolute; + top: 0; + left: 0; + width: 182px; + height: 182px; + object-fit: cover; + mix-blend-mode: multiply; + z-index: 2; +} +.group-24-1-group { + height: 430px; + width: 566.5px; + position: absolute; + margin: 0 !important; + top: -182px; + left: -24px; +} +.blank-line1, +.erstelle-ein-post, +.p, +.scanne-den-qr1 { + margin: 0; +} +.erstelle-ein-post-container { + height: 289px; + flex: 1; + position: relative; + font-weight: 300; + display: inline-block; + max-width: 100%; + z-index: 1; +} +.frame-parent4 { + align-self: stretch; + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + position: relative; + max-width: 100%; + text-align: left; + font-size: var(--font-size-13xl); + color: var(--color-black); +} +.mindestbestellwert-betrgt-201 { + align-self: stretch; + position: relative; + font-weight: 300; +} +.frame-child1, +.h31 { + position: relative; + max-width: 100%; +} +.frame-child1 { + height: 104px; + width: 527px; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + display: none; +} +.h31 { + margin: 0; + height: 100px; + flex: 1; + font-size: inherit; + letter-spacing: 0.29em; + font-weight: 300; + font-family: inherit; + display: flex; + align-items: center; + justify-content: center; + z-index: 1; +} +.mindestbestellwert-betrgt-20-parent, +.rectangle-container { + display: flex; + align-items: flex-start; + justify-content: flex-start; + max-width: 100%; +} +.rectangle-container { + align-self: stretch; + border-radius: var(--br-6xs); + background-color: var(--color-tan); + flex-direction: row; + padding: var(--padding-11xs) var(--padding-mid); + box-sizing: border-box; + font-size: var(--font-size-29xl); + color: var(--color-darkslategray); +} +.mindestbestellwert-betrgt-20-parent { + flex: 1; + flex-direction: column; + gap: var(--gap-mini-5); +} +.frame-wrapper1 { + align-self: stretch; + flex-direction: row; + padding: 0 var(--padding-6xs) 0 var(--padding-5xs-5); + box-sizing: border-box; + max-width: 100%; + font-size: var(--font-size-xl); + color: var(--color-dimgray-100); +} +.frame-group, +.frame-parent2, +.frame-parent3, +.frame-wrapper1 { + display: flex; + align-items: flex-start; + justify-content: flex-start; +} +.frame-parent3 { + align-self: stretch; + flex-direction: column; + gap: var(--gap-sm-5); + flex-shrink: 0; + debug_commit: 1de1738; + text-align: center; + font-size: var(--font-size-5xl); + color: var(--color-gray); +} +.frame-group, +.frame-parent2 { + box-sizing: border-box; +} +.frame-parent2 { + height: 750px; + width: 591px; + border-radius: var(--br-xl); + background-color: var(--color-floralwhite); + overflow: hidden; + flex-shrink: 0; + flex-direction: column; + padding: var(--padding-150xl) var(--padding-lgi-5) var(--padding-xl) + var(--padding-10xl); +} +.frame-group { + width: 1979px; + overflow-x: auto; + flex-direction: row; + flex-wrap: wrap; + padding: 230.5px 43px; + gap: 60px 58px; + max-width: 100%; +} +.die-angaben-basieren { + height: 50px; + flex: 1; + position: relative; + font-weight: 300; + display: flex; + align-items: center; + max-width: 100%; +} +.die-angaben-basieren-jediglich-wrapper, +.frame-parent, +.root-container { + display: flex; + justify-content: flex-start; + text-align: left; + font-family: var(--font-outfit); +} +.die-angaben-basieren-jediglich-wrapper { + width: 1878px; + flex-direction: row; + align-items: flex-start; + padding: 0 30px; + box-sizing: border-box; + max-width: 100%; + font-size: var(--font-size-5xl); + color: #666; +} +.frame-parent, +.root-container { + flex-direction: column; + color: var(--color-black); +} +.frame-parent { + align-items: flex-start; + gap: 26px; + max-width: 100%; + font-size: var(--font-size-45xl); +} +.root-container { + width: 100%; + position: relative; + background-color: #fff; + overflow: hidden; + align-items: flex-end; + padding: 23px 62px 25px 59px; + box-sizing: border-box; + gap: 3px; + line-height: normal; + letter-spacing: normal; + font-size: 96px; +} +@media screen and (max-width: 1200px) { + .shopping-cart-icon-parent { + padding-top: 407px; + padding-bottom: var(--padding-xl); + box-sizing: border-box; + } + .frame-group { + padding: 150px 21px; + box-sizing: border-box; + } +} +@media screen and (max-width: 1050px) { + .gutscheine { + font-size: var(--font-size-29xl); + } + .redeem-fill1-wght300-grad0-ops-parent { + flex-wrap: wrap; + } + .auf-alles { + font-size: var(--font-size-32xl); + } + .auf-deinen-nchsten, + .freigeschaltet { + font-size: var(--font-size-7xl); + } + .syfwa2g { + font-size: var(--font-size-19xl); + } + .auf-alles1 { + font-size: var(--font-size-32xl); + } + .bewerte-dein-gekauftes-container, + .freischaltbar { + font-size: var(--font-size-7xl); + } + .h3 { + font-size: var(--font-size-19xl); + } + .frame-container { + padding-top: var(--padding-91xl); + box-sizing: border-box; + } + .auf-alles2 { + font-size: var(--font-size-32xl); + } + .erstelle-ein-post-container, + .freischaltbar1 { + font-size: var(--font-size-7xl); + } + .h31 { + font-size: var(--font-size-19xl); + } + .frame-parent2 { + padding-top: var(--padding-91xl); + box-sizing: border-box; + } + .root-container { + padding-left: var(--padding-10xl); + padding-right: 31px; + box-sizing: border-box; + } +} +@media screen and (max-width: 750px) { + .shopping-cart-icon-parent { + padding-top: 265px; + box-sizing: border-box; + } + .frame-container, + .frame-group, + .frame-parent2 { + padding-top: var(--padding-52xl); + box-sizing: border-box; + } + .frame-group { + gap: var(--gap-10xl); + padding-top: var(--padding-78xl); + padding-bottom: var(--padding-78xl); + } +} +@media screen and (max-width: 450px) { + .gutscheine { + font-size: var(--font-size-10xl); + } + .redeem-fill1-wght300-grad0-ops-parent { + gap: var(--gap-10xl); + } + .auf-alles { + font-size: var(--font-size-19xl); + } + .auf-deinen-nchsten, + .freigeschaltet { + font-size: var(--font-size-lgi); + } + .syfwa2g { + font-size: var(--font-size-10xl); + } + .auf-alles1 { + font-size: var(--font-size-19xl); + } + .bewerte-dein-gekauftes-container, + .dauer-5-minuten, + .freischaltbar { + font-size: var(--font-size-lgi); + } + .mindestbestellwert-betrgt-20 { + font-size: var(--font-size-base); + } + .h3 { + font-size: var(--font-size-10xl); + } + .auf-alles2 { + font-size: var(--font-size-19xl); + } + .dauer-5-minuten1, + .erstelle-ein-post-container, + .freischaltbar1 { + font-size: var(--font-size-lgi); + } + .mindestbestellwert-betrgt-201 { + font-size: var(--font-size-base); + } + .h31 { + font-size: var(--font-size-10xl); + } + .die-angaben-basieren { + font-size: var(--font-size-lgi); + } +} diff --git a/groupTasks/groups/shx-order/index.json b/groupTasks/groups/shx-order/index.json new file mode 100644 index 0000000..1e02a55 --- /dev/null +++ b/groupTasks/groups/shx-order/index.json @@ -0,0 +1,47 @@ +{ + "category": "Shinnex", + "name": "Bestellung", + "globalInputs": [ + { + "parameterName": "orderId", + "type": "text", + "displayName": "Bestellnummer" + }, + { + "parameterName": "customerEmail", + "type": "text", + "displayName": "E-Mail vom Kunden" + } + ], + "tasks": [ + { + "name": "CRM Customer", + "onFinish": "next", + "undoPossible": false, + "repeatPossible": true, + "scriptPath": "crmCustomer.py", + "parameters": [ + { + "parameterName": "orderId", + "type": "text", + "displayName": "Bestellnummer", + "global": true + }, + { + "parameterName": "customerEmail", + "type": "text", + "displayName": "E-Mail vom Kunden", + "global": true + } + ] + }, + { + "name": "Gutscheine", + "onFinish": "next", + "undoPossible": false, + "repeatPossible": true, + "scriptPath": "discounts.py", + "parameters": [] + } + ] +} \ No newline at end of file diff --git a/groupTasks/groups/shx-order/lock-fill1-wght300-grad0-opsz20-1.svg b/groupTasks/groups/shx-order/lock-fill1-wght300-grad0-opsz20-1.svg new file mode 100644 index 0000000..b1c8602 --- /dev/null +++ b/groupTasks/groups/shx-order/lock-fill1-wght300-grad0-opsz20-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/lock-open-fill1-wght300-grad0-opsz20-1.svg b/groupTasks/groups/shx-order/lock-open-fill1-wght300-grad0-opsz20-1.svg new file mode 100644 index 0000000..ae300c6 --- /dev/null +++ b/groupTasks/groups/shx-order/lock-open-fill1-wght300-grad0-opsz20-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/lock_FILL1_wght300_GRAD0_opsz20 1.png b/groupTasks/groups/shx-order/lock_FILL1_wght300_GRAD0_opsz20 1.png new file mode 100644 index 0000000..294dd11 Binary files /dev/null and b/groupTasks/groups/shx-order/lock_FILL1_wght300_GRAD0_opsz20 1.png differ diff --git a/groupTasks/groups/shx-order/lock_open_FILL1_wght300_GRAD0_opsz20 1.png b/groupTasks/groups/shx-order/lock_open_FILL1_wght300_GRAD0_opsz20 1.png new file mode 100644 index 0000000..21b45b3 Binary files /dev/null and b/groupTasks/groups/shx-order/lock_open_FILL1_wght300_GRAD0_opsz20 1.png differ diff --git a/groupTasks/groups/shx-order/logo.png b/groupTasks/groups/shx-order/logo.png new file mode 100644 index 0000000..7f7f5f5 Binary files /dev/null and b/groupTasks/groups/shx-order/logo.png differ diff --git a/groupTasks/groups/shx-order/logoBackPage.png b/groupTasks/groups/shx-order/logoBackPage.png new file mode 100644 index 0000000..5fc80f7 Binary files /dev/null and b/groupTasks/groups/shx-order/logoBackPage.png differ diff --git a/groupTasks/groups/shx-order/pdf.py b/groupTasks/groups/shx-order/pdf.py new file mode 100644 index 0000000..e69de29 diff --git a/groupTasks/groups/shx-order/qrcode.png b/groupTasks/groups/shx-order/qrcode.png new file mode 100644 index 0000000..d21d351 Binary files /dev/null and b/groupTasks/groups/shx-order/qrcode.png differ diff --git a/groupTasks/groups/shx-order/redeem-fill1-wght300-grad0-opsz20-1.svg b/groupTasks/groups/shx-order/redeem-fill1-wght300-grad0-opsz20-1.svg new file mode 100644 index 0000000..67e8ad8 --- /dev/null +++ b/groupTasks/groups/shx-order/redeem-fill1-wght300-grad0-opsz20-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/groupTasks/groups/shx-order/requirements.txt b/groupTasks/groups/shx-order/requirements.txt new file mode 100644 index 0000000..baee381 --- /dev/null +++ b/groupTasks/groups/shx-order/requirements.txt @@ -0,0 +1,5 @@ +requests==2.31.0 +reportlab==4.1.0 +pdfkit==1.0.0 +qrcode==7.4.2 +PyPDF2==3.0.1 \ No newline at end of file diff --git a/groupTasks/groups/shx-order/style.css b/groupTasks/groups/shx-order/style.css new file mode 100644 index 0000000..d0182d5 --- /dev/null +++ b/groupTasks/groups/shx-order/style.css @@ -0,0 +1,127 @@ +.container { + background-color: #fdf8ef; + width: 250px; + padding: 12px; + border-radius: 20px; + margin-right: 12px; +} + +.container:last-child { + margin-right: 0; +} + +.container-background { + position: absolute; + top: 0; + width: 330px; + height: 600px; + z-index: 2; + background-image: url(background.svg); + background-repeat: no-repeat; + background-position: center; + background-size: 50%; + opacity: 0.1; + top: 25px; +} + +.container-background.first-item { + left: 35px; +} + +.container-background.second-item { + left: 325px; +} + +.container-background.third-item { + left: 610px; +} + +.container-header { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.container-header p { + font-size: 22px; + margin: 0; +} + +.container-header .percentage { + font-weight: bold; +} + +.container-header img { + margin-bottom: 10px; +} + +.container-action { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.container-action img { + height: 100px; +} + +.container-action .status-box { + background-color: rgba(185, 147, 99, 0.1); + border-radius: 7px; + padding: 6px 16px; +} + +.container-action .status-box .closed { + color: #a80000; +} + +.container-action .status-box .open { + color: #0c620a; +} + +.container-action .time-needed-box { + text-align: center; +} + +.container-action .time-needed-box span { + color: #5a5a5a; + font-size: 12px; +} + +.minimum-order-value-box { + text-align: center; + padding-bottom: 4px; +} + +.minimum-order-value-box span { + color: #616161; + font-size: 12px; +} + +.code-box { + background-color: rgba(185, 147, 99, 0.1); + border-radius: 7px; + text-align: center; +} + +.code-box.first-item { + padding-top: 1px; + padding-bottom: 3px; +} + +.code-box.second-item, +.code-box.third-item { + padding-top: 4px; +} + +.code-box span { + font-size: 20px; + letter-spacing: 0.29em; + font-weight: 300; +} diff --git a/groupTasks/groups/shx-order/test.pdf b/groupTasks/groups/shx-order/test.pdf new file mode 100644 index 0000000..9038cea Binary files /dev/null and b/groupTasks/groups/shx-order/test.pdf differ diff --git a/main b/main index 7e3d7f4..9cd6ded 100755 Binary files a/main and b/main differ diff --git a/modules/grouptasks/grouptasks.go b/modules/grouptasks/grouptasks.go index a787c03..fc2dcdd 100644 --- a/modules/grouptasks/grouptasks.go +++ b/modules/grouptasks/grouptasks.go @@ -496,7 +496,7 @@ func RunGroupTask(args RunGroupTaskArgs) { return err } - if !info.IsDir() && filepath.Ext(path) == ".py" { + if !info.IsDir() && /* filepath.Ext(path) == ".py" */ info.Name() != "requirements.txt" && info.Name() != "index.json" { bytesRead, err := os.ReadFile(path) if err != nil { diff --git a/public/swagger/swagger.json b/public/swagger/swagger.json index b69594c..85d0b26 100644 --- a/public/swagger/swagger.json +++ b/public/swagger/swagger.json @@ -163,6 +163,45 @@ } } }, + "/crm/customer": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Get crm customer", + "operationId": "crmGetCrmCustomer", + "parameters": [ + { + "description": "Crm customer", + "name": "crmCustomer", + "in": "body", + "schema": { + "$ref": "#/definitions/CrmCustomer" + } + } + ], + "responses": { + "200": { + "description": "Crm customer", + "schema": { + "$ref": "#/definitions/CrmTableCustomer" + } + }, + "400": { + "description": "Invalid request query" + }, + "401": { + "description": "No permissions" + }, + "500": { + "description": "Failed to get crm customer" + } + } + } + }, "/crm/customer/create": { "post": { "produces": [ @@ -263,8 +302,8 @@ "tags": [ "crm" ], - "summary": "Get crm customer", - "operationId": "crmGetCrmCustomer", + "summary": "Get crm customer by id", + "operationId": "crmGetCrmCustomerById", "parameters": [ { "description": "Customer id", @@ -294,6 +333,32 @@ } } }, + "/crm/customers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "crm" + ], + "summary": "Get all crm customers", + "operationId": "crmGetAllCustomers", + "responses": { + "200": { + "description": "Crm customers", + "schema": { + "$ref": "#/definitions/CrmTableCustomer" + } + }, + "401": { + "description": "No permissions" + }, + "500": { + "description": "Failed to get crm customers" + } + } + } + }, "/crm/link/{id}": { "post": { "produces": [ @@ -330,7 +395,7 @@ } } }, - "/crm/links/create": { + "/crm/links": { "post": { "produces": [ "application/json" @@ -438,48 +503,6 @@ } } }, - "/crm/pipeline/{type}/{dealPhase}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "crm" - ], - "summary": "Get crm customers", - "operationId": "crmGetCrmCustomers", - "parameters": [ - { - "description": "Page number", - "name": "page", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Crm customers", - "schema": { - "$ref": "#/definitions/CrmTableCustomerResponse" - } - }, - "400": { - "description": "Invalid request query" - }, - "401": { - "description": "No permissions" - }, - "404": { - "description": "Crm type not found" - }, - "422": { - "description": "Deal phase not set" - }, - "500": { - "description": "Failed to get crm customers" - } - } - } - }, "/equipment/documentation/create": { "post": { "consumes": [ diff --git a/routers/router/api/v1/crm/crm.go b/routers/router/api/v1/crm/crm.go index 8e71160..6694238 100644 --- a/routers/router/api/v1/crm/crm.go +++ b/routers/router/api/v1/crm/crm.go @@ -1,8 +1,6 @@ package crm import ( - "fmt" - "jannex/admin-dashboard-backend/modules/crm" "jannex/admin-dashboard-backend/modules/database" "jannex/admin-dashboard-backend/modules/logger" "jannex/admin-dashboard-backend/modules/structs" @@ -12,15 +10,28 @@ import ( "time" "git.ex.umbach.dev/Alex/roese-utils/rslogger" - "git.ex.umbach.dev/Alex/roese-utils/rspagination" "github.com/go-sql-driver/mysql" "github.com/gofiber/fiber/v2" "github.com/google/uuid" "gorm.io/gorm" ) -// testing func GetAllCustomers(c *fiber.Ctx) error { + // swagger:operation GET /crm/customers crm crmGetAllCustomers + // --- + // summary: Get all crm customers + // produces: + // - application/json + // responses: + // '200': + // description: Crm customers + // schema: + // "$ref": "#/definitions/CrmTableCustomer" + // '401': + // description: No permissions + // '500': + // description: Failed to get crm customers + var customers []structs.CrmTableCustomer database.DB.Find(&customers) @@ -32,32 +43,8 @@ func GetAllCustomers(c *fiber.Ctx) error { return c.JSON(customers) } +/* func GetCrmTypeCustomers(c *fiber.Ctx) error { - // swagger:operation GET /crm/pipeline/{type}/{dealPhase} crm crmGetCrmCustomers - // --- - // summary: Get crm customers - // produces: - // - application/json - // parameters: - // - name: page - // in: query - // description: Page number - // responses: - // '200': - // description: Crm customers - // schema: - // "$ref": "#/definitions/CrmTableCustomerResponse" - // '400': - // description: Invalid request query - // '401': - // description: No permissions - // '404': - // description: Crm type not found - // '422': - // description: Deal phase not set - // '500': - // description: Failed to get crm customers - var params structs.CrmTypeCustomerRequest if err := c.ParamsParser(¶ms); err != nil { @@ -115,11 +102,58 @@ func GetCrmTypeCustomers(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusNotFound) } +*/ +// find customer by provided filters in body - used by groupTasks python scripts func GetCrmCustomer(c *fiber.Ctx) error { - // swagger:operation GET /crm/customer/view/{id} crm crmGetCrmCustomer + // swagger:operation POST /crm/customer crm crmGetCrmCustomer // --- - // summary: Get crm customer + // summary: Get crm customer by filters + // produces: + // - application/json + // parameters: + // - name: crmCustomer + // in: body + // description: Crm customer + // schema: + // "$ref": "#/definitions/CrmCustomer" + // responses: + // '200': + // description: Crm customer + // schema: + // "$ref": "#/definitions/CrmTableCustomer" + // '400': + // description: Invalid request query + // '401': + // description: No permissions + // '500': + // description: Failed to get crm customer + + var body structs.CrmCustomer + + if err := c.BodyParser(&body); err != nil { + return c.SendStatus(fiber.StatusBadRequest) + } + + if !socketclients.HasPermission(c.Locals("userId").(string), utils.PermissionCrmCustomersView) { + return c.SendStatus(fiber.StatusUnauthorized) + } + + var customers []structs.CrmTableCustomer + + database.DB.Find(&customers, body) + + sort.Slice(customers, func(i, j int) bool { + return customers[i].CreatedAt.After(customers[j].CreatedAt) + }) + + return c.JSON(customers) +} + +func GetCrmCustomerById(c *fiber.Ctx) error { + // swagger:operation GET /crm/customer/view/{id} crm crmGetCrmCustomerById + // --- + // summary: Get crm customer by id // produces: // - application/json // parameters: @@ -312,8 +346,6 @@ func CreateCrmCustomer(c *fiber.Ctx) error { database.DB.Model(&structs.CrmCustomer{}).Where("company = ?", crmCustomer["Company"]).Count(&count) - fmt.Println("count", count, crmCustomer["Company"]) - if count > 0 { logger.AddCrmLog(rslogger.LogTypeError, "Failed to create crm customer as company name already exists: %v", crmCustomer) return c.SendStatus(fiber.StatusConflict) diff --git a/routers/router/router.go b/routers/router/router.go index de78221..18be442 100644 --- a/routers/router/router.go +++ b/routers/router/router.go @@ -68,8 +68,9 @@ func SetupRoutes(app *fiber.App) { l.Get("/", requestAccessValidation, logmanagerserverconnections.GetConnectedLogManagerServers) c := v1.Group("/crm") - c.Get("/pipeline/:type/:dealPhase", requestAccessValidation, crm.GetCrmTypeCustomers) - c.Get("/customer/view/:id", requestAccessValidation, crm.GetCrmCustomer) + // c.Get("/pipeline/:type/:dealPhase", requestAccessValidation, crm.GetCrmTypeCustomers) + c.Post("/customer", requestAccessValidation, crm.GetCrmCustomer) + c.Get("/customer/view/:id", requestAccessValidation, crm.GetCrmCustomerById) c.Post("/customer/update/:id", requestAccessValidation, crm.UpdateCrmCustomer) c.Post("/customer/create", requestAccessValidation, crm.CreateCrmCustomer)