Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a78e523b2 | ||
|
|
7f68471b85 |
@@ -2415,6 +2415,12 @@ paths:
|
||||
type: string
|
||||
description: Contact person name
|
||||
example: "Mikkel"
|
||||
ean:
|
||||
type: string
|
||||
description: Optional EAN used for e-invoicing in e-conomic
|
||||
maxLength: 13
|
||||
pattern: '^[0-9]{1,13}$'
|
||||
example: "5790001234567"
|
||||
g_recaptcha_response:
|
||||
type: string
|
||||
description: reCAPTCHA verification token
|
||||
@@ -8189,6 +8195,12 @@ paths:
|
||||
email: {type: string}
|
||||
phone: {type: integer}
|
||||
name: {type: string}
|
||||
ean:
|
||||
type: string
|
||||
description: Optional EAN used for e-invoicing in e-conomic
|
||||
maxLength: 13
|
||||
pattern: '^[0-9]{1,13}$'
|
||||
example: "5790001234567"
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
|
||||
@@ -95,6 +95,7 @@ export const sourceMappings = [
|
||||
/^src\/assets\/pos\.css$/u,
|
||||
/^src\/components\/displays\/boxes\/ProductBox\.vue$/u,
|
||||
/^src\/features\/customer\/customerProductRules\.js$/u,
|
||||
/^src\/services\/economicCustomerIdentifiers\.js$/u,
|
||||
],
|
||||
specs: [
|
||||
"tests/e2e/pos-flow.spec.js",
|
||||
|
||||
+19
@@ -62,6 +62,7 @@ watch(
|
||||
form.invoiceEmail,
|
||||
form.contactEmail,
|
||||
form.contactPhone,
|
||||
form.ean,
|
||||
canCreateCustomer.value,
|
||||
searchResult.value,
|
||||
errorMessage.value,
|
||||
@@ -124,6 +125,24 @@ watch(
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
><small>{{ $t("admin.pos.ean") }}</small></label
|
||||
>
|
||||
<div class="control">
|
||||
<input
|
||||
v-model="form.ean"
|
||||
class="input"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
maxlength="13"
|
||||
:placeholder="$t('admin.pos.ean')"
|
||||
:disabled="searchResult === null || submitting"
|
||||
data-testid="pos-mobile-add-customer-ean"
|
||||
@input="handleAutofillFieldInput('ean')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
><small>{{ $t("admin.pos.invoice_email") }}</small></label
|
||||
|
||||
@@ -3,6 +3,7 @@ export const POS_ADD_CUSTOMER_AUTOFILL_FIELDS = [
|
||||
"invoiceEmail",
|
||||
"contactEmail",
|
||||
"contactPhone",
|
||||
"ean",
|
||||
];
|
||||
|
||||
export function normalizePosAddCustomerValue(value) {
|
||||
@@ -20,6 +21,7 @@ export function createPosAddCustomerFields(overrides = {}) {
|
||||
invoiceEmail: "",
|
||||
contactEmail: "",
|
||||
contactPhone: "",
|
||||
ean: "",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -30,6 +32,7 @@ export function createPosAddCustomerManualOverrides(overrides = {}) {
|
||||
invoiceEmail: false,
|
||||
contactEmail: false,
|
||||
contactPhone: false,
|
||||
ean: false,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -93,6 +96,7 @@ export function buildPosAddCustomerAutofillValues(searchResult) {
|
||||
invoiceEmail: normalizePosAddCustomerValue(searchResult?.email),
|
||||
contactEmail: normalizePosAddCustomerValue(searchResult?.email),
|
||||
contactPhone: normalizePosAddCustomerValue(searchResult?.phone),
|
||||
ean: normalizePosAddCustomerValue(searchResult?.ean),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import axios from "axios";
|
||||
import { API_URL } from "@/config.js";
|
||||
import { getError, parseError, removeError } from "@/components/request/HandleGlobalError.vue";
|
||||
import LoadButtonWhileAwait from "@/components/request/LoadButtonWhileAwait.vue";
|
||||
import { economicEanPayloadValue, normalizeEconomicEan } from "@/services/economicCustomerIdentifiers.js";
|
||||
|
||||
const customerFormData = reactive({
|
||||
cvr: null,
|
||||
contactEmail: null,
|
||||
contactPhone: null
|
||||
contactPhone: null,
|
||||
ean: null
|
||||
});
|
||||
|
||||
const deliverSuccess = ref(false);
|
||||
@@ -17,17 +19,24 @@ let deliverTimeoutId;
|
||||
const submitCustomer = async () => {
|
||||
removeError("authRegisterCvr");
|
||||
try {
|
||||
await axios.post(API_URL + "/auth/register/cvr", {
|
||||
const payload = {
|
||||
cvr: customerFormData.cvr,
|
||||
invoiceEmail: customerFormData.contactEmail,
|
||||
contactEmail: customerFormData.contactEmail,
|
||||
contactPhone: customerFormData.contactPhone,
|
||||
companyPhone: customerFormData.contactPhone
|
||||
});
|
||||
};
|
||||
const ean = economicEanPayloadValue(customerFormData.ean);
|
||||
if (ean !== undefined) {
|
||||
payload.ean = ean;
|
||||
}
|
||||
|
||||
await axios.post(API_URL + "/auth/register/cvr", payload);
|
||||
|
||||
customerFormData.contactPhone = null;
|
||||
customerFormData.contactEmail = null;
|
||||
customerFormData.cvr = null;
|
||||
customerFormData.ean = null;
|
||||
|
||||
deliverSuccess.value = true;
|
||||
deliverTimeoutId = setTimeout(() => {
|
||||
@@ -59,6 +68,20 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="customer_ean">{{ $t("customer_creation.customer.ean_label") }}</label>
|
||||
<input
|
||||
id="customer_ean"
|
||||
:value="customerFormData.ean"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
maxlength="13"
|
||||
autocomplete="off"
|
||||
placeholder="5790001234567"
|
||||
@input="customerFormData.ean = normalizeEconomicEan($event.target.value)"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="email">{{ $t("customer_creation.customer.email_label") }}</label>
|
||||
<input id="email" v-model="customerFormData.contactEmail" type="email" name="email" autocomplete="email">
|
||||
|
||||
@@ -405,6 +405,24 @@ watch(activeQuickAction, (nextMode, previousMode) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
><small>{{ $t("admin.pos.ean") }}</small></label
|
||||
>
|
||||
<div class="control">
|
||||
<input
|
||||
v-model="addCustomerForm.ean"
|
||||
class="input"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
maxlength="13"
|
||||
:placeholder="$t('admin.pos.ean')"
|
||||
:disabled="addCustomerSearchResult === null || isAddCustomerSubmitting"
|
||||
data-testid="pos-desktop-add-customer-ean"
|
||||
@input="handleAddCustomerFieldInput('ean')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
><small>{{ $t("admin.pos.invoice_email") }}</small></label
|
||||
|
||||
@@ -2,6 +2,7 @@ import { computed, onBeforeUnmount, reactive, ref, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { searchAndSelectCustomer } from "@/components/shop/POSDepartmentProcess.vue";
|
||||
import SessionUser from "@/components/session/token/SessionUser.vue";
|
||||
import { economicEanPayloadValue } from "@/services/economicCustomerIdentifiers.js";
|
||||
import {
|
||||
applyPosAddCustomerSearchResult,
|
||||
createPosAddCustomerFields,
|
||||
@@ -152,14 +153,20 @@ export function usePosAddCustomerForm(options = {}) {
|
||||
errorMessage.value = null;
|
||||
|
||||
try {
|
||||
await SessionUser.request("/auth/register/cvr", "POST", {
|
||||
const payload = {
|
||||
cvr: form.cvr,
|
||||
companyPhone: Number.parseInt(form.companyPhone, 10),
|
||||
invoiceEmail: form.invoiceEmail,
|
||||
contactEmail: form.contactEmail,
|
||||
contactPhone: Number.parseInt(form.contactPhone, 10),
|
||||
searchResult: searchResult.value,
|
||||
});
|
||||
};
|
||||
const ean = economicEanPayloadValue(form.ean);
|
||||
if (ean !== undefined) {
|
||||
payload.ean = ean;
|
||||
}
|
||||
|
||||
await SessionUser.request("/auth/register/cvr", "POST", payload);
|
||||
|
||||
const selectedCustomer = await searchAndSelectCustomer(form.companyPhone);
|
||||
const createdCustomerNumber = Number.parseInt(form.companyPhone, 10);
|
||||
|
||||
@@ -1711,6 +1711,7 @@
|
||||
"company_phone": "Virksomhedstelefon",
|
||||
"contact_email": "@.capitalize:{'words.generated.kontakt'}-@:{'words.generated.e'}-@:{'words.generated.mail'}",
|
||||
"contact_phone": "Kontakttelefon",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'words.generated.oprettet'} @:{'words.generated.af'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'words.replication.article.host_mention'} @:{'words.generated.indtastede'} @:{'words.generated.nummerplade'} @:{'words.generated.tilhører'} @:{'words.replication.host_definite_suffix'} @:{'words.generated.anden'} @:{'words.generated.gemt'} @:{'words.generated.kunde'}. @.capitalize:{'words.generated.vælg'} @:{'words.generated.om'} @:{'words.replication.article.host_mention'} @:{'words.generated.valgte'} @:{'words.generated.kunde'} @:{'words.generated.skal'} @:{'words.generated.beholdes'}, @:{'words.generated.eller'} @:{'words.generated.om'} @:{'words.generated.der'} @:{'words.generated.skal'} @:{'words.generated.skiftes'} @:{'words.generated.til'} @:{'words.generated.køretøjets'} @:{'words.generated.kunde'}.",
|
||||
@@ -3259,6 +3260,7 @@
|
||||
"benefit_portal": "@:{'words.generated.kundeportal'}",
|
||||
"benefit_portal_desc": "@:{'words.generated.benyt'} kundeportalen @:{'words.generated.til'} @:{'words.generated.at'} @:{'words.generated.tilføje'} @:{'words.generated.køretøjer'}, @:{'words.generated.booke'} @:{'words.generated.vaske'}, downloade @:{'words.generated.fakturaer'}, @:{'words.generated.vaskecertifikater'} @:{'words.generated.og'} @:{'words.generated.information'} @:{'words.generated.for'} @:{'words.generated.historiske'} @:{'words.generated.vaske'}",
|
||||
"benefit_wash_desc": "@:{'words.generated.benyt'} @:{'words.generated.vores'} @:{'words.generated.nationale'} @:{'words.generated.netværk'} @:{'words.generated.af'} @:{'words.generated.vaskehaller'} @:{'words.generated.til'} @:{'words.generated.konkurrencedygtige'} @:{'words.generated.priser'}",
|
||||
"ean_label": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"email_label": "@:{'words.generated.firma'} @:{'words.generated.email'}",
|
||||
"intro": "@.capitalize:{'words.generated.som'} @:{'words.generated.kunde'} @:{'words.generated.hos'} @:{'words.generated.truck'} @:{'words.generated.wash'} @:{'words.generated.far'} @:{'words.generated.du'} @:{'words.generated.adgang'} @:{'words.generated.til'}:",
|
||||
"phone_label": "@:{'words.generated.firma'} @:{'words.generated.telefon'}",
|
||||
|
||||
@@ -1822,6 +1822,7 @@
|
||||
"company_phone": "Firmentelefon",
|
||||
"contact_email": "@:{'words.generated.kontakt'}-@.upper:{'words.generated.e'}-@:{'words.generated.mail'}",
|
||||
"contact_phone": "Kontakttelefonnummer",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'words.generated.erstellt'} @:{'words.generated.von'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'words.generated.dieses'} @:{'words.generated.kennzeichen'} @:{'words.generated.gehoert'} @:{'words.generated.zu'} @:{'words.generated.einem'} @:{'words.generated.anderen'} @:{'words.generated.gespeicherten'} @:{'words.generated.kunden'}. @:{'words.generated.waehlen'} @.capitalize:{'words.generated.sie'}, @:{'words.generated.ob'} @:{'words.generated.der'} @:{'words.generated.ausgewaehlte'} @.capitalize:{'words.generated.kunde'} @:{'words.generated.beibehalten'} @:{'words.generated.oder'} @:{'words.generated.zum'} @:{'words.generated.fahrzeugkunden'} @:{'words.generated.gewechselt'} @:{'words.generated.werden'} @:{'words.generated.soll'}.",
|
||||
@@ -3370,6 +3371,7 @@
|
||||
"benefit_portal": "@:{'words.generated.kundenportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'words.generated.nutzen'} @.capitalize:{'words.generated.sie'} @:{'words.generated.das'} @:{'words.generated.kundenportal'}, @:{'words.generated.um'} @:{'words.generated.fahrzeuge'} hinzuzuf?@:{'words.generated.gen'}, @.upper:{'words.generated.w'}?@:{'words.generated.schen'} @:{'words.generated.zu'} @:{'words.generated.buchen'}, @:{'words.generated.rechnungen'} @:{'words.generated.und'} @:{'words.generated.waschzertifikate'} herunterzuladen @:{'words.generated.sowie'} @:{'words.generated.informationen'} @:{'words.generated.zu'} @:{'words.generated.fr'}?@:{'words.generated.heren'} @.upper:{'words.generated.w'}?@:{'words.generated.schen'} einzusehen",
|
||||
"benefit_wash_desc": "@.capitalize:{'words.generated.nutzen'} @.capitalize:{'words.generated.sie'} @:{'words.generated.unser'} @:{'words.generated.nationales'} @:{'words.generated.netz'} @:{'words.generated.von'} @:{'words.generated.waschhallen'} @:{'words.generated.zu'} @:{'words.generated.wettbewerbsf'}?@:{'words.generated.higen'} @:{'words.generated.preisen'}",
|
||||
"ean_label": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"email_label": "Firmen-@.upper:{'words.generated.e'}-@:{'words.generated.mail'}",
|
||||
"intro": "@.capitalize:{'words.generated.als'} @.capitalize:{'words.generated.kunde'} @:{'words.generated.bei'} @:{'words.generated.truck'} @.capitalize:{'words.generated.wash'} @:{'words.generated.erhalten'} @.capitalize:{'words.generated.sie'} @:{'words.generated.zugang'} @:{'words.generated.zu'}:",
|
||||
"phone_label": "@:{'templates.generated.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -1543,6 +1543,7 @@
|
||||
"company_phone": "@.capitalize:{'words.generated.company'} @:{'words.generated.phone'}",
|
||||
"contact_email": "@.capitalize:{'words.generated.contact'} @:{'words.generated.email'}",
|
||||
"contact_phone": "@.capitalize:{'words.generated.contact'} @:{'words.generated.phone'}",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'words.generated.created'} @:{'words.generated.by'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'words.generated.this'} @:{'words.generated.typed'} @:{'words.generated.plate'} @:{'words.generated.belongs'} @:{'words.generated.to'} @:{'words.generated.another'} @:{'words.generated.saved'} @:{'words.generated.customer'}. @.capitalize:{'words.generated.choose'} @:{'words.generated.whether'} @:{'words.generated.to'} @:{'words.generated.keep'} @:{'words.replication.article.host_mention'} @:{'words.generated.selected'} @:{'words.generated.customer'} @:{'words.generated.or'} @:{'words.generated.switch'} @:{'words.generated.to'} @:{'words.replication.article.host_mention'} @:{'words.generated.vehicle'} @:{'words.generated.customer'}.",
|
||||
@@ -3091,6 +3092,7 @@
|
||||
"benefit_portal": "@.capitalize:{'words.generated.customer'} @.capitalize:{'words.generated.portal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'words.generated.use'} @:{'words.replication.article.host_mention'} @:{'words.generated.customer'} @:{'words.generated.portal'} @:{'words.generated.to'} @:{'words.generated.add'} @:{'words.generated.vehicles'}, @:{'words.generated.book'} @:{'words.generated.washes'}, @:{'words.generated.download'} @:{'words.generated.invoices'}, @:{'words.generated.wash'} @:{'words.generated.certificates'} @:{'words.generated.and'} @:{'words.generated.information'} @:{'words.generated.for'} @:{'words.generated.historical'} @:{'words.generated.washes'}",
|
||||
"benefit_wash_desc": "@.capitalize:{'words.generated.use'} @:{'words.generated.our'} @:{'words.generated.national'} @:{'words.generated.network'} @:{'words.generated.of'} @:{'words.generated.wash'} @:{'words.generated.halls'} @:{'words.generated.at'} @:{'words.generated.competitive'} @:{'words.generated.prices'}",
|
||||
"ean_label": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"email_label": "@.capitalize:{'words.generated.company'} @:{'words.generated.email'}",
|
||||
"intro": "@.capitalize:{'words.generated.as'} @:{'words.generated.a'} @:{'words.generated.customer'} @:{'words.generated.at'} @.capitalize:{'words.generated.truck'} @.capitalize:{'words.generated.wash'} @:{'words.generated.you'} @:{'words.generated.get'} @:{'words.generated.access'} @:{'words.generated.to'}:",
|
||||
"phone_label": "@:{'templates.generated.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -385,6 +385,7 @@
|
||||
"delete": "@:{'templates.generated.compat.global.delete'}",
|
||||
"details": "@:{'templates.generated.compat.admin.pos.details'}",
|
||||
"download": "@:{'templates.generated.compat.guest.pwa.title'}",
|
||||
"ean": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"drafts_assignment": {
|
||||
"button": "@:{'templates.generated.compat.admin.pos.drafts_assignment.button'}",
|
||||
"create_invoice_collection": "@:{'templates.generated.compat.admin.pos.drafts_assignment.create_invoice_collection'}",
|
||||
@@ -2061,6 +2062,7 @@
|
||||
"benefit_wash": "@:{'templates.generated.compat.tables.bookings.wash'}",
|
||||
"benefit_wash_desc": "@:{'templates.generated.compat.tables.bookings.wash_desc'}",
|
||||
"cvr_label": "@:{'templates.generated.compat.customers.cvr'}",
|
||||
"ean_label": "@:{'templates.generated.compat.customer_creation.customer.ean_label'}",
|
||||
"email_label": "@:{'templates.generated.compat.customer_creation.customer.email_label'}",
|
||||
"intro": "@:{'templates.generated.compat.customer_creation.customer.intro'}",
|
||||
"phone_label": "@:{'templates.generated.compat.customer_creation.customer.phone_label'}",
|
||||
|
||||
@@ -1825,6 +1825,7 @@
|
||||
"company_phone": "Firmatelefon",
|
||||
"contact_email": "@.capitalize:{'words.generated.kontakt'} @:{'words.generated.e'}-@:{'words.generated.post'}",
|
||||
"contact_phone": "@.capitalize:{'words.generated.kontakt'} @:{'words.generated.telefon'}",
|
||||
"ean": "EAN",
|
||||
"created_by": "Laget @:{'words.generated.av'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'words.generated.det'} @:{'words.generated.innskrevne'} @:{'words.generated.skiltet'} @:{'words.generated.tilhoerer'} @:{'words.replication.host_definite_suffix'} @:{'words.generated.annen'} @:{'words.generated.lagret'} @:{'words.generated.kunde'}. @.capitalize:{'words.generated.velg'} @:{'words.generated.om'} @:{'words.replication.article.host_mention'} @:{'words.generated.valgte'} @:{'words.generated.kunden'} @:{'words.generated.skal'} @:{'words.generated.beholdes'} @:{'words.generated.eller'} @:{'words.generated.om'} @:{'words.generated.det'} @:{'words.generated.skal'} @:{'words.generated.byttes'} @:{'words.generated.til'} @:{'words.generated.kjoretoykunden'}.",
|
||||
@@ -3373,6 +3374,7 @@
|
||||
"benefit_portal": "@:{'words.generated.kundeportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'words.generated.bruk'} kundeportalen @:{'words.generated.til'} @:{'words.generated.a'} @:{'words.generated.legge'} @:{'words.generated.til'} @:{'words.generated.kjøretøy'}, bokvaske, @:{'words.generated.laste'} @:{'words.generated.ned'} @:{'words.generated.fakturaer'}, @:{'words.generated.vaskesertifikater'} @:{'words.generated.og'} @:{'words.generated.informasjon'} @:{'words.generated.for'} @:{'words.generated.historiske'} @:{'words.generated.vask'}.",
|
||||
"benefit_wash_desc": "@.capitalize:{'words.generated.bruk'} @:{'words.generated.vart'} @:{'words.generated.nasjonale'} @:{'words.generated.nettverk'} @:{'words.generated.av'} @:{'words.generated.vaskehaller'} @:{'words.generated.til'} @:{'words.generated.konkurransedyktige'} @:{'words.generated.priser'}",
|
||||
"ean_label": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"email_label": "Firmaets @:{'words.generated.e'}-@:{'words.generated.post'}",
|
||||
"intro": "@.capitalize:{'words.generated.som'} @:{'words.generated.kunde'} @:{'words.generated.hos'} @:{'words.generated.truck'} @.capitalize:{'words.generated.wash'} @:{'words.generated.far'} @:{'words.generated.du'} @:{'words.generated.tilgang'} @:{'words.generated.til'}:",
|
||||
"phone_label": "@:{'templates.generated.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -1875,6 +1875,7 @@
|
||||
"company_phone": "Färetagstelefon",
|
||||
"contact_email": "@.capitalize:{'words.generated.kontakt'}-@:{'words.generated.e'}-@:{'words.generated.post'}",
|
||||
"contact_phone": "Kontakttelefon",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'words.generated.skapad'} @:{'words.generated.av'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'words.generated.det'} @:{'words.generated.angivna'} @:{'words.generated.registreringsnumret'} @:{'words.generated.tillhor'} @:{'words.replication.host_definite_suffix'} @:{'words.generated.annan'} @:{'words.generated.sparad'} @:{'words.generated.kund'}. @:{'words.generated.valj_2'} @:{'words.generated.om'} @:{'words.replication.article.host_mention'} @:{'words.generated.valda'} @:{'words.generated.kunden'} @:{'words.generated.ska'} @:{'words.generated.behallas'} @:{'words.generated.eller'} @:{'words.generated.om'} @:{'words.generated.bytet'} @:{'words.generated.ska'} @:{'words.generated.goras'} @:{'words.generated.till'} @:{'words.generated.fordonskunden'}.",
|
||||
@@ -3423,6 +3424,7 @@
|
||||
"benefit_portal": "@:{'words.generated.kundportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'words.generated.anvand'} kundportalen @:{'words.generated.for'} @:{'words.generated.att'} @:{'words.generated.lagga'} @:{'words.generated.till'} @:{'words.generated.fordon'}, @:{'words.generated.boka'} @:{'words.generated.tvattar'}, @:{'words.generated.ladda'} @:{'words.generated.ner'} @:{'words.generated.fakturor'}, @:{'words.generated.tvattcertifikat'} @:{'words.generated.och'} @:{'words.generated.information'} @:{'words.generated.om'} @:{'words.generated.historiska'} @:{'words.generated.tvattar'}",
|
||||
"benefit_wash_desc": "@.capitalize:{'words.generated.anvand'} @:{'words.generated.vart'} @:{'words.generated.nationella'} @:{'words.generated.natverk'} @:{'words.generated.av'} @:{'words.generated.tvatthallar'} @:{'words.generated.till'} @:{'words.generated.konkurrenskraftiga'} @:{'words.generated.priser'}",
|
||||
"ean_label": "@:{'templates.generated.compat.admin.pos.ean'}",
|
||||
"email_label": "Företagets @:{'words.generated.e'}-@:{'words.generated.post'}",
|
||||
"intro": "@.capitalize:{'words.generated.som'} @:{'words.generated.kund'} @:{'words.generated.hos'} @:{'words.generated.truck'} @.capitalize:{'words.generated.wash'} @:{'words.generated.far'} @:{'words.generated.du'} @:{'words.generated.tillgang'} @:{'words.generated.till'}:",
|
||||
"phone_label": "@:{'templates.generated.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
"company_phone": "Virksomhedstelefon",
|
||||
"contact_email": "@.capitalize:{'terms.glossary.kontakt'}-@:{'terms.glossary.e'}-@:{'terms.glossary.mail'}",
|
||||
"contact_phone": "Kontakttelefon",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'terms.glossary.oprettet'} @:{'terms.glossary.af'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'terms.replication.article.host_mention'} @:{'terms.glossary.indtastede'} @:{'terms.glossary.nummerplade'} @:{'terms.glossary.tilhører'} @:{'terms.replication.host_definite_suffix'} @:{'terms.glossary.anden'} @:{'terms.glossary.gemt'} @:{'terms.glossary.kunde'}. @.capitalize:{'terms.glossary.vælg'} @:{'terms.glossary.om'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.valgte'} @:{'terms.glossary.kunde'} @:{'terms.glossary.skal'} @:{'terms.glossary.beholdes'}, @:{'terms.glossary.eller'} @:{'terms.glossary.om'} @:{'terms.glossary.der'} @:{'terms.glossary.skal'} @:{'terms.glossary.skiftes'} @:{'terms.glossary.til'} @:{'terms.glossary.køretøjets'} @:{'terms.glossary.kunde'}.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"benefit_portal": "@:{'terms.glossary.kundeportal'}",
|
||||
"benefit_portal_desc": "@:{'terms.glossary.benyt'} kundeportalen @:{'terms.glossary.til'} @:{'terms.glossary.at'} @:{'terms.glossary.tilføje'} @:{'terms.glossary.køretøjer'}, @:{'terms.glossary.booke'} @:{'terms.glossary.vaske'}, downloade @:{'terms.glossary.fakturaer'}, @:{'terms.glossary.vaskecertifikater'} @:{'terms.glossary.og'} @:{'terms.glossary.information'} @:{'terms.glossary.for'} @:{'terms.glossary.historiske'} @:{'terms.glossary.vaske'}",
|
||||
"benefit_wash_desc": "@:{'terms.glossary.benyt'} @:{'terms.glossary.vores'} @:{'terms.glossary.nationale'} @:{'terms.glossary.netværk'} @:{'terms.glossary.af'} @:{'terms.glossary.vaskehaller'} @:{'terms.glossary.til'} @:{'terms.glossary.konkurrencedygtige'} @:{'terms.glossary.priser'}",
|
||||
"ean_label": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"email_label": "@:{'terms.glossary.firma'} @:{'terms.glossary.email'}",
|
||||
"intro": "@.capitalize:{'terms.glossary.som'} @:{'terms.glossary.kunde'} @:{'terms.glossary.hos'} @:{'terms.glossary.truck'} @:{'terms.glossary.wash'} @:{'terms.glossary.far'} @:{'terms.glossary.du'} @:{'terms.glossary.adgang'} @:{'terms.glossary.til'}:",
|
||||
"phone_label": "@:{'terms.glossary.firma'} @:{'terms.glossary.telefon'}",
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
"company_phone": "Firmentelefon",
|
||||
"contact_email": "@:{'terms.glossary.kontakt'}-@.upper:{'terms.glossary.e'}-@:{'terms.glossary.mail'}",
|
||||
"contact_phone": "Kontakttelefonnummer",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'terms.glossary.erstellt'} @:{'terms.glossary.von'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'terms.glossary.dieses'} @:{'terms.glossary.kennzeichen'} @:{'terms.glossary.gehoert'} @:{'terms.glossary.zu'} @:{'terms.glossary.einem'} @:{'terms.glossary.anderen'} @:{'terms.glossary.gespeicherten'} @:{'terms.glossary.kunden'}. @:{'terms.glossary.waehlen'} @.capitalize:{'terms.glossary.sie'}, @:{'terms.glossary.ob'} @:{'terms.glossary.der'} @:{'terms.glossary.ausgewaehlte'} @.capitalize:{'terms.glossary.kunde'} @:{'terms.glossary.beibehalten'} @:{'terms.glossary.oder'} @:{'terms.glossary.zum'} @:{'terms.glossary.fahrzeugkunden'} @:{'terms.glossary.gewechselt'} @:{'terms.glossary.werden'} @:{'terms.glossary.soll'}.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"benefit_portal": "@:{'terms.glossary.kundenportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'terms.glossary.nutzen'} @.capitalize:{'terms.glossary.sie'} @:{'terms.glossary.das'} @:{'terms.glossary.kundenportal'}, @:{'terms.glossary.um'} @:{'terms.glossary.fahrzeuge'} hinzuzuf?@:{'terms.glossary.gen'}, @.upper:{'terms.glossary.w'}?@:{'terms.glossary.schen'} @:{'terms.glossary.zu'} @:{'terms.glossary.buchen'}, @:{'terms.glossary.rechnungen'} @:{'terms.glossary.und'} @:{'terms.glossary.waschzertifikate'} herunterzuladen @:{'terms.glossary.sowie'} @:{'terms.glossary.informationen'} @:{'terms.glossary.zu'} @:{'terms.glossary.fr'}?@:{'terms.glossary.heren'} @.upper:{'terms.glossary.w'}?@:{'terms.glossary.schen'} einzusehen",
|
||||
"benefit_wash_desc": "@.capitalize:{'terms.glossary.nutzen'} @.capitalize:{'terms.glossary.sie'} @:{'terms.glossary.unser'} @:{'terms.glossary.nationales'} @:{'terms.glossary.netz'} @:{'terms.glossary.von'} @:{'terms.glossary.waschhallen'} @:{'terms.glossary.zu'} @:{'terms.glossary.wettbewerbsf'}?@:{'terms.glossary.higen'} @:{'terms.glossary.preisen'}",
|
||||
"ean_label": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"email_label": "Firmen-@.upper:{'terms.glossary.e'}-@:{'terms.glossary.mail'}",
|
||||
"intro": "@.capitalize:{'terms.glossary.als'} @.capitalize:{'terms.glossary.kunde'} @:{'terms.glossary.bei'} @:{'terms.glossary.truck'} @.capitalize:{'terms.glossary.wash'} @:{'terms.glossary.erhalten'} @.capitalize:{'terms.glossary.sie'} @:{'terms.glossary.zugang'} @:{'terms.glossary.zu'}:",
|
||||
"phone_label": "@:{'phrases.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
"company_phone": "@.capitalize:{'terms.glossary.company'} @:{'terms.glossary.phone'}",
|
||||
"contact_email": "@.capitalize:{'terms.glossary.contact'} @:{'terms.glossary.email'}",
|
||||
"contact_phone": "@.capitalize:{'terms.glossary.contact'} @:{'terms.glossary.phone'}",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'terms.glossary.created'} @:{'terms.glossary.by'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'terms.glossary.this'} @:{'terms.glossary.typed'} @:{'terms.glossary.plate'} @:{'terms.glossary.belongs'} @:{'terms.glossary.to'} @:{'terms.glossary.another'} @:{'terms.glossary.saved'} @:{'terms.glossary.customer'}. @.capitalize:{'terms.glossary.choose'} @:{'terms.glossary.whether'} @:{'terms.glossary.to'} @:{'terms.glossary.keep'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.selected'} @:{'terms.glossary.customer'} @:{'terms.glossary.or'} @:{'terms.glossary.switch'} @:{'terms.glossary.to'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.vehicle'} @:{'terms.glossary.customer'}.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"benefit_portal": "@.capitalize:{'terms.glossary.customer'} @.capitalize:{'terms.glossary.portal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'terms.glossary.use'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.customer'} @:{'terms.glossary.portal'} @:{'terms.glossary.to'} @:{'terms.glossary.add'} @:{'terms.glossary.vehicles'}, @:{'terms.glossary.book'} @:{'terms.glossary.washes'}, @:{'terms.glossary.download'} @:{'terms.glossary.invoices'}, @:{'terms.glossary.wash'} @:{'terms.glossary.certificates'} @:{'terms.glossary.and'} @:{'terms.glossary.information'} @:{'terms.glossary.for'} @:{'terms.glossary.historical'} @:{'terms.glossary.washes'}",
|
||||
"benefit_wash_desc": "@.capitalize:{'terms.glossary.use'} @:{'terms.glossary.our'} @:{'terms.glossary.national'} @:{'terms.glossary.network'} @:{'terms.glossary.of'} @:{'terms.glossary.wash'} @:{'terms.glossary.halls'} @:{'terms.glossary.at'} @:{'terms.glossary.competitive'} @:{'terms.glossary.prices'}",
|
||||
"ean_label": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"email_label": "@.capitalize:{'terms.glossary.company'} @:{'terms.glossary.email'}",
|
||||
"intro": "@.capitalize:{'terms.glossary.as'} @:{'terms.glossary.a'} @:{'terms.glossary.customer'} @:{'terms.glossary.at'} @.capitalize:{'terms.glossary.truck'} @.capitalize:{'terms.glossary.wash'} @:{'terms.glossary.you'} @:{'terms.glossary.get'} @:{'terms.glossary.access'} @:{'terms.glossary.to'}:",
|
||||
"phone_label": "@:{'phrases.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -293,6 +293,7 @@
|
||||
"delete": "@:{'phrases.compat.global.delete'}",
|
||||
"details": "@:{'phrases.compat.admin.pos.details'}",
|
||||
"download": "@:{'phrases.compat.guest.pwa.title'}",
|
||||
"ean": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"drafts_assignment": {
|
||||
"button": "@:{'phrases.compat.admin.pos.drafts_assignment.button'}",
|
||||
"create_invoice_collection": "@:{'phrases.compat.admin.pos.drafts_assignment.create_invoice_collection'}",
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"benefit_wash": "@:{'phrases.compat.tables.bookings.wash'}",
|
||||
"benefit_wash_desc": "@:{'phrases.compat.tables.bookings.wash_desc'}",
|
||||
"cvr_label": "@:{'phrases.compat.customers.cvr'}",
|
||||
"ean_label": "@:{'phrases.compat.customer_creation.customer.ean_label'}",
|
||||
"email_label": "@:{'phrases.compat.customer_creation.customer.email_label'}",
|
||||
"intro": "@:{'phrases.compat.customer_creation.customer.intro'}",
|
||||
"phone_label": "@:{'phrases.compat.customer_creation.customer.phone_label'}",
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
"company_phone": "Firmatelefon",
|
||||
"contact_email": "@.capitalize:{'terms.glossary.kontakt'} @:{'terms.glossary.e'}-@:{'terms.glossary.post'}",
|
||||
"contact_phone": "@.capitalize:{'terms.glossary.kontakt'} @:{'terms.glossary.telefon'}",
|
||||
"ean": "EAN",
|
||||
"created_by": "Laget @:{'terms.glossary.av'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'terms.glossary.det'} @:{'terms.glossary.innskrevne'} @:{'terms.glossary.skiltet'} @:{'terms.glossary.tilhoerer'} @:{'terms.replication.host_definite_suffix'} @:{'terms.glossary.annen'} @:{'terms.glossary.lagret'} @:{'terms.glossary.kunde'}. @.capitalize:{'terms.glossary.velg'} @:{'terms.glossary.om'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.valgte'} @:{'terms.glossary.kunden'} @:{'terms.glossary.skal'} @:{'terms.glossary.beholdes'} @:{'terms.glossary.eller'} @:{'terms.glossary.om'} @:{'terms.glossary.det'} @:{'terms.glossary.skal'} @:{'terms.glossary.byttes'} @:{'terms.glossary.til'} @:{'terms.glossary.kjoretoykunden'}.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"benefit_portal": "@:{'terms.glossary.kundeportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'terms.glossary.bruk'} kundeportalen @:{'terms.glossary.til'} @:{'terms.glossary.a'} @:{'terms.glossary.legge'} @:{'terms.glossary.til'} @:{'terms.glossary.kjøretøy'}, bokvaske, @:{'terms.glossary.laste'} @:{'terms.glossary.ned'} @:{'terms.glossary.fakturaer'}, @:{'terms.glossary.vaskesertifikater'} @:{'terms.glossary.og'} @:{'terms.glossary.informasjon'} @:{'terms.glossary.for'} @:{'terms.glossary.historiske'} @:{'terms.glossary.vask'}.",
|
||||
"benefit_wash_desc": "@.capitalize:{'terms.glossary.bruk'} @:{'terms.glossary.vart'} @:{'terms.glossary.nasjonale'} @:{'terms.glossary.nettverk'} @:{'terms.glossary.av'} @:{'terms.glossary.vaskehaller'} @:{'terms.glossary.til'} @:{'terms.glossary.konkurransedyktige'} @:{'terms.glossary.priser'}",
|
||||
"ean_label": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"email_label": "Firmaets @:{'terms.glossary.e'}-@:{'terms.glossary.post'}",
|
||||
"intro": "@.capitalize:{'terms.glossary.som'} @:{'terms.glossary.kunde'} @:{'terms.glossary.hos'} @:{'terms.glossary.truck'} @.capitalize:{'terms.glossary.wash'} @:{'terms.glossary.far'} @:{'terms.glossary.du'} @:{'terms.glossary.tilgang'} @:{'terms.glossary.til'}:",
|
||||
"phone_label": "@:{'phrases.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
"company_phone": "Färetagstelefon",
|
||||
"contact_email": "@.capitalize:{'terms.glossary.kontakt'}-@:{'terms.glossary.e'}-@:{'terms.glossary.post'}",
|
||||
"contact_phone": "Kontakttelefon",
|
||||
"ean": "EAN",
|
||||
"created_by": "@.capitalize:{'terms.glossary.skapad'} @:{'terms.glossary.av'}",
|
||||
"customer_conflict": {
|
||||
"help_text": "@.capitalize:{'terms.glossary.det'} @:{'terms.glossary.angivna'} @:{'terms.glossary.registreringsnumret'} @:{'terms.glossary.tillhor'} @:{'terms.replication.host_definite_suffix'} @:{'terms.glossary.annan'} @:{'terms.glossary.sparad'} @:{'terms.glossary.kund'}. @:{'terms.glossary.valj_2'} @:{'terms.glossary.om'} @:{'terms.replication.article.host_mention'} @:{'terms.glossary.valda'} @:{'terms.glossary.kunden'} @:{'terms.glossary.ska'} @:{'terms.glossary.behallas'} @:{'terms.glossary.eller'} @:{'terms.glossary.om'} @:{'terms.glossary.bytet'} @:{'terms.glossary.ska'} @:{'terms.glossary.goras'} @:{'terms.glossary.till'} @:{'terms.glossary.fordonskunden'}.",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"benefit_portal": "@:{'terms.glossary.kundportal'}",
|
||||
"benefit_portal_desc": "@.capitalize:{'terms.glossary.anvand'} kundportalen @:{'terms.glossary.for'} @:{'terms.glossary.att'} @:{'terms.glossary.lagga'} @:{'terms.glossary.till'} @:{'terms.glossary.fordon'}, @:{'terms.glossary.boka'} @:{'terms.glossary.tvattar'}, @:{'terms.glossary.ladda'} @:{'terms.glossary.ner'} @:{'terms.glossary.fakturor'}, @:{'terms.glossary.tvattcertifikat'} @:{'terms.glossary.och'} @:{'terms.glossary.information'} @:{'terms.glossary.om'} @:{'terms.glossary.historiska'} @:{'terms.glossary.tvattar'}",
|
||||
"benefit_wash_desc": "@.capitalize:{'terms.glossary.anvand'} @:{'terms.glossary.vart'} @:{'terms.glossary.nationella'} @:{'terms.glossary.natverk'} @:{'terms.glossary.av'} @:{'terms.glossary.tvatthallar'} @:{'terms.glossary.till'} @:{'terms.glossary.konkurrenskraftiga'} @:{'terms.glossary.priser'}",
|
||||
"ean_label": "@:{'phrases.compat.admin.pos.ean'}",
|
||||
"email_label": "Företagets @:{'terms.glossary.e'}-@:{'terms.glossary.post'}",
|
||||
"intro": "@.capitalize:{'terms.glossary.som'} @:{'terms.glossary.kund'} @:{'terms.glossary.hos'} @:{'terms.glossary.truck'} @.capitalize:{'terms.glossary.wash'} @:{'terms.glossary.far'} @:{'terms.glossary.du'} @:{'terms.glossary.tillgang'} @:{'terms.glossary.till'}:",
|
||||
"phone_label": "@:{'phrases.compat.admin.pos.company_phone'}",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
export function normalizeEconomicEan(value) {
|
||||
if (value === null || value === undefined) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return String(value).replace(/\D+/g, "");
|
||||
}
|
||||
|
||||
export function economicEanPayloadValue(value) {
|
||||
const normalized = normalizeEconomicEan(value);
|
||||
return normalized === "" ? undefined : normalized;
|
||||
}
|
||||
@@ -591,6 +591,7 @@ async function mockPosApi(page, fixture) {
|
||||
city: body?.searchResult?.city || "Taastrup",
|
||||
mobilePhone: String(body.contactPhone || body.companyPhone || ""),
|
||||
email: body.contactEmail || body.invoiceEmail || "",
|
||||
ean: String(body.ean || ""),
|
||||
corporateIdentificationNumber: String(body.cvr || "").padStart(8, "0"),
|
||||
barred: false,
|
||||
};
|
||||
@@ -1503,6 +1504,7 @@ test.describe("POS flow", () => {
|
||||
const invoiceEmail = page.getByTestId("pos-desktop-add-customer-invoice-email");
|
||||
const contactEmail = page.getByTestId("pos-desktop-add-customer-contact-email");
|
||||
const contactPhone = page.getByTestId("pos-desktop-add-customer-contact-phone");
|
||||
const ean = page.getByTestId("pos-desktop-add-customer-ean");
|
||||
const submitButton = page.getByTestId("pos-desktop-add-customer-submit");
|
||||
|
||||
await expect(newCustomerButton).toBeVisible();
|
||||
@@ -1517,15 +1519,18 @@ test.describe("POS flow", () => {
|
||||
await expect(invoiceEmail).toHaveValue("mikkel@truckwash.dk");
|
||||
await expect(contactEmail).toHaveValue("mikkel@truckwash.dk");
|
||||
await expect(contactPhone).toHaveValue("21754690");
|
||||
await expect(ean).toHaveValue("");
|
||||
|
||||
await companyPhone.fill("55550000");
|
||||
await contactEmail.fill("dispatch@truckwash.test");
|
||||
await ean.fill("5790001234567");
|
||||
await searchInput.fill("43423010");
|
||||
|
||||
await expect(companyPhone).toHaveValue("55550000", { timeout: 10_000 });
|
||||
await expect(contactEmail).toHaveValue("dispatch@truckwash.test");
|
||||
await expect(invoiceEmail).toHaveValue("billing@wash-group.test");
|
||||
await expect(contactPhone).toHaveValue("42331128");
|
||||
await expect(ean).toHaveValue("5790001234567");
|
||||
await expect(submitButton).toBeEnabled();
|
||||
|
||||
await submitButton.click();
|
||||
@@ -1536,6 +1541,7 @@ test.describe("POS flow", () => {
|
||||
await expect(page.locator(".field.has-addons input[disabled]")).toHaveValue("Wash Group ApS", { timeout: 10_000 });
|
||||
await expect(page.getByRole("button", { name: "Ryd" })).toBeVisible();
|
||||
await expect.poll(() => fixture.customerRegistrations.length, { timeout: 10_000 }).toBe(1);
|
||||
expect(fixture.customerRegistrations[0]).toMatchObject({ ean: "5790001234567" });
|
||||
await expect.poll(() => fixture.cvrSearches.length, { timeout: 10_000 }).toBe(2);
|
||||
});
|
||||
|
||||
|
||||
@@ -1015,6 +1015,7 @@ test.describe("POS mobile order flow", () => {
|
||||
const invoiceEmail = page.getByTestId("pos-mobile-add-customer-invoice-email");
|
||||
const contactEmail = page.getByTestId("pos-mobile-add-customer-contact-email");
|
||||
const contactPhone = page.getByTestId("pos-mobile-add-customer-contact-phone");
|
||||
const ean = page.getByTestId("pos-mobile-add-customer-ean");
|
||||
const submitButton = page.getByTestId("pos-mobile-add-customer-submit");
|
||||
|
||||
await searchInput.fill("41004355");
|
||||
@@ -1022,10 +1023,12 @@ test.describe("POS mobile order flow", () => {
|
||||
await expect(invoiceEmail).toHaveValue("mikkel@truckwash.dk");
|
||||
await expect(contactEmail).toHaveValue("mikkel@truckwash.dk");
|
||||
await expect(contactPhone).toHaveValue("21754690");
|
||||
await expect(ean).toHaveValue("");
|
||||
await expect(submitButton).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
await companyPhone.fill("55550000");
|
||||
await contactEmail.fill("dispatch@truckwash.test");
|
||||
await ean.fill("5790001234567");
|
||||
|
||||
await searchInput.fill("43423010");
|
||||
|
||||
@@ -1033,6 +1036,7 @@ test.describe("POS mobile order flow", () => {
|
||||
await expect(contactEmail).toHaveValue("dispatch@truckwash.test");
|
||||
await expect(invoiceEmail).toHaveValue("billing@wash-group.test");
|
||||
await expect(contactPhone).toHaveValue("42331128");
|
||||
await expect(ean).toHaveValue("5790001234567");
|
||||
await expect(submitButton).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ function mountComponent(props = {}) {
|
||||
invoice_email: "Invoice email",
|
||||
contact_email: "Contact email",
|
||||
contact_phone: "Contact phone",
|
||||
ean: "EAN",
|
||||
add_customer: "Add customer",
|
||||
customer_creation_error: "Error: {error}",
|
||||
customer_creation_error_generic: "Unable to create customer",
|
||||
@@ -253,6 +254,7 @@ describe("CustomerSearchFieldPos", () => {
|
||||
invoiceEmail: "billing@wash-group.test",
|
||||
contactEmail: "dispatch@wash-group.test",
|
||||
contactPhone: 42331128,
|
||||
ean: "5790001234567",
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -286,6 +288,7 @@ describe("CustomerSearchFieldPos", () => {
|
||||
|
||||
await wrapper.get('[data-testid="pos-desktop-add-customer-company-phone"]').setValue("55550000");
|
||||
await wrapper.get('[data-testid="pos-desktop-add-customer-contact-email"]').setValue("dispatch@wash-group.test");
|
||||
await wrapper.get('[data-testid="pos-desktop-add-customer-ean"]').setValue("5790001234567");
|
||||
await wrapper.get('[data-testid="pos-desktop-add-customer-submit"]').trigger("click");
|
||||
await flushComponentUpdates();
|
||||
|
||||
|
||||
@@ -91,4 +91,11 @@ describe("Playwright PR mapping", () => {
|
||||
"tests/e2e/limited-backoffice.spec.ts"
|
||||
);
|
||||
});
|
||||
|
||||
it("maps e-conomic customer identifier changes to POS customer registration E2E coverage", () => {
|
||||
const specs = specsFor("src/services/economicCustomerIdentifiers.js");
|
||||
|
||||
expect(specs).toContain("tests/e2e/pos-flow.spec.js");
|
||||
expect(specs).toContain("tests/e2e/pos-mobile-order-flow.spec.js");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,6 +35,7 @@ describe("POS mobile add-customer autofill", () => {
|
||||
invoiceEmail: "mikkel@truckwash.dk",
|
||||
contactEmail: "mikkel@truckwash.dk",
|
||||
contactPhone: "21754690",
|
||||
ean: "",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -69,6 +70,7 @@ describe("POS mobile add-customer autofill", () => {
|
||||
invoiceEmail: "billing@wash-group.test",
|
||||
contactEmail: "billing@wash-group.test",
|
||||
contactPhone: "42331128",
|
||||
ean: "",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -76,6 +78,7 @@ describe("POS mobile add-customer autofill", () => {
|
||||
const manualOverrides = createPosAddCustomerManualOverrides({
|
||||
companyPhone: true,
|
||||
contactEmail: true,
|
||||
ean: true,
|
||||
});
|
||||
|
||||
const nextFields = applyPosAddCustomerSearchResult({
|
||||
@@ -85,6 +88,7 @@ describe("POS mobile add-customer autofill", () => {
|
||||
invoiceEmail: "old-invoice@example.com",
|
||||
contactEmail: "dispatch@example.com",
|
||||
contactPhone: "21754690",
|
||||
ean: "5790001234567",
|
||||
}),
|
||||
manualOverrides,
|
||||
searchResult: createSearchResult({
|
||||
@@ -100,6 +104,24 @@ describe("POS mobile add-customer autofill", () => {
|
||||
expect(nextFields.invoiceEmail).toBe("billing@wash-group.test");
|
||||
expect(nextFields.contactPhone).toBe("42331128");
|
||||
expect(nextFields.cvr).toBe("43423010");
|
||||
expect(nextFields.ean).toBe("5790001234567");
|
||||
});
|
||||
|
||||
it("preserves manually entered EAN across later autofill passes", () => {
|
||||
const nextFields = applyPosAddCustomerSearchResult({
|
||||
fields: createPosAddCustomerFields({
|
||||
ean: "5790001234567",
|
||||
}),
|
||||
manualOverrides: createPosAddCustomerManualOverrides({
|
||||
ean: true,
|
||||
}),
|
||||
searchResult: createSearchResult({
|
||||
ean: "5790007654321",
|
||||
}),
|
||||
notFoundLabel: "Not found",
|
||||
});
|
||||
|
||||
expect(nextFields.ean).toBe("5790001234567");
|
||||
});
|
||||
|
||||
it("refills a field after the operator clears a manual override", () => {
|
||||
|
||||
Reference in New Issue
Block a user