Skip to content

Commit dd45506

Browse files
committed
customer account filters are now available in Frontend API
- adds order and complaint filtering by search, date range, and status codes - exposes status counts for dynamic customer account status tabs - extends GraphQL coverage for the new filter behavior
1 parent b28917c commit dd45506

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/Migrations/Version20240816221930.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ public function up(Schema $schema): void
3737

3838
$this->createComplaintStatus(1, ComplaintStatusTypeEnum::STATUS_TYPE_NEW);
3939
$this->createComplaintStatus(2, ComplaintStatusTypeEnum::STATUS_TYPE_RESOLVED);
40+
$this->createComplaintStatus(3, ComplaintStatusTypeEnum::STATUS_TYPE_IN_PROGRESS);
4041

4142
foreach ($this->getAllLocales() as $locale) {
4243
$this->createComplaintStatusTranslations(1, t('New [adjective]', [], Translator::DEFAULT_TRANSLATION_DOMAIN, $locale), $locale);
4344
$this->createComplaintStatusTranslations(2, t('Resolved', [], Translator::DEFAULT_TRANSLATION_DOMAIN, $locale), $locale);
45+
$this->createComplaintStatusTranslations(3, t('In Progress', [], Translator::DEFAULT_TRANSLATION_DOMAIN, $locale), $locale);
4446
}
4547

46-
$this->sql('ALTER SEQUENCE complaint_statuses_id_seq RESTART WITH 3');
48+
$this->sql('ALTER SEQUENCE complaint_statuses_id_seq RESTART WITH 4');
4749

4850
$this->sql('ALTER TABLE complaints ADD status_id INT NULL');
4951
$this->sql('

src/Migrations/Version20240910054629.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ final class Version20240910054629 extends AbstractMigration implements DomainAwa
1616

1717
private const string COMPLAINT_STATUS_1 = 'complaint_status_1';
1818
private const string COMPLAINT_STATUS_2 = 'complaint_status_2';
19+
private const string COMPLAINT_STATUS_3 = 'complaint_status_3';
1920

2021
#[Override]
2122
public function up(Schema $schema): void
2223
{
2324
$this->insertMailTemplateIfNotExist(self::COMPLAINT_STATUS_1);
2425
$this->insertMailTemplateIfNotExist(self::COMPLAINT_STATUS_2);
26+
$this->insertMailTemplateIfNotExist(self::COMPLAINT_STATUS_3);
2527

2628
$this->sql('UPDATE mail_templates SET complaint_status_id = 1 WHERE name = :mailTemplateName', ['mailTemplateName' => self::COMPLAINT_STATUS_1]);
2729
$this->sql('UPDATE mail_templates SET complaint_status_id = 2 WHERE name = :mailTemplateName', ['mailTemplateName' => self::COMPLAINT_STATUS_2]);
30+
$this->sql('UPDATE mail_templates SET complaint_status_id = 3 WHERE name = :mailTemplateName', ['mailTemplateName' => self::COMPLAINT_STATUS_3]);
2831

2932
foreach ($this->getAllDomainIds() as $domainId) {
3033
$domainLocale = $this->getDomainLocale($domainId);
@@ -52,6 +55,18 @@ public function up(Schema $schema): void
5255
'domainId' => $domainId,
5356
],
5457
);
58+
59+
$this->sql(
60+
'UPDATE mail_templates SET subject = :subject, body = :body WHERE name = :mailTemplateName AND domain_id = :domainId',
61+
[
62+
'mailTemplateName' => self::COMPLAINT_STATUS_3,
63+
'subject' => t('Status of complaint with number {complaint_number} from order number {order_number} created on {date} has changed', [], Translator::DEFAULT_TRANSLATION_DOMAIN, $domainLocale),
64+
'body' => $this->wrapMailTemplateBodyForGrapesJs(
65+
t('Dear customer, <br /><br />Your complaint with number {complaint_number} from order number {order_number} created {date} with preferred resolution {complaint_resolution} is being processed. For more information, visit <a href="{complaint_detail_url}" tabindex="0">complaint detail</a>.<br /><br />Do you need anything else? Visit our <a href="{url}" tabindex="0">website</a>.', [], Translator::DEFAULT_TRANSLATION_DOMAIN, $domainLocale),
66+
),
67+
'domainId' => $domainId,
68+
],
69+
);
5570
}
5671
}
5772
}

0 commit comments

Comments
 (0)