4873-zone.delivery-day #1248

Merged
vicent merged 8 commits from 4873-zone.delivery-day into dev 2023-02-03 12:28:36 +00:00
Contributor
No description provided.
vicent added the
CR / Tests passed
label 2023-01-10 13:13:15 +00:00
vicent added 1 commit 2023-01-10 13:13:17 +00:00
gitea/salix/pipeline/head This commit looks good Details
484b8d42e1
fix: corregido sql
vicent changed title from fix: corregido sql to 4873-zone.delivery-day 2023-01-10 13:13:49 +00:00
vicent requested review from joan 2023-01-10 13:14:01 +00:00
vicent added 1 commit 2023-01-10 13:14:20 +00:00
gitea/salix/pipeline/head This commit looks good Details
ae3b26b202
Merge branch 'dev' into 4873-zone.delivery-day
joan added 1 commit 2023-01-12 06:18:18 +00:00
gitea/salix/pipeline/head This commit looks good Details
3f7dee63ac
Merge branch 'dev' into 4873-zone.delivery-day
joan requested review from juan 2023-01-12 06:25:10 +00:00
joan refused to review 2023-01-12 06:25:13 +00:00
juan requested changes 2023-01-19 20:33:01 +00:00
@ -30,8 +30,11 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const dated = new Date(date);
Owner

Esto es necesario? Si se define el argumento como tipo Date debería llegar una fecha

Esto es necesario? Si se define el argumento como tipo Date debería llegar una fecha
vicent marked this conversation as resolved
@ -31,2 +31,4 @@
Object.assign(myOptions, options);
const dated = new Date(date);
const dayName = dated.toString().split(' ')[0];
Owner

No nesario si se pasa directamente date a la función

No nesario si se pasa directamente date a la función
vicent marked this conversation as resolved
@ -49,1 +50,3 @@
OR INSTR(weekDays, SUBSTRING(DAYNAME(?), 1, 3) ) > 0
dated = ?
OR ? BETWEEN started AND ended
OR weekDays LIKE ?
Owner

Pasar la fecha directamnte y comparar así: ze.weekDays & (1 << WEEKDAY(?))

Además hay que tener en cuenta el tipo de evento type.

Todas las columnas de la consulta debería llevar el alias de la tabla.

Pasar la fecha directamnte y comparar así: `ze.weekDays & (1 << WEEKDAY(?))` Además hay que tener en cuenta el tipo de evento `type`. Todas las columnas de la consulta debería llevar el alias de la tabla.
vicent marked this conversation as resolved
@ -53,3 +56,3 @@
GROUP BY z.id`;
return Self.rawSql(query, [date, date, date, zoneIds], myOptions);
return Self.rawSql(query, [date, date, dayName, zoneIds], myOptions);
Owner

Pasar date en lugar de dayName

Pasar `date` en lugar de `dayName`
vicent marked this conversation as resolved
vicent added 1 commit 2023-01-20 07:17:11 +00:00
gitea/salix/pipeline/head This commit looks good Details
5d19da48e2
refactor: actualizada consulta sql
vicent requested review from juan 2023-01-20 07:21:53 +00:00
juan requested changes 2023-01-26 16:41:12 +00:00
@ -54,0 +46,4 @@
(
ze.dated = ?
OR ? BETWEEN ze.started AND ze.ended
OR ze.weekDays & (1 << WEEKDAY(?))
Owner

S'ha de tindre en compte tambe la columna type de zoneEvent, mira el WHERE del procediment vn.zone_getOptionsForLanding

S'ha de tindre en compte tambe la columna `type` de `zoneEvent`, mira el WHERE del procediment `vn.zone_getOptionsForLanding`
Author
Contributor

Pero aixo ja ho fa:

 WHERE
                        (
                            ze.dated = ?
                            OR ? BETWEEN ze.started AND ze.ended
                            OR ze.weekDays & (1 << WEEKDAY(?))
                        )

pq depen del camps q tinga rellenats es un type o altre.

Pero aixo ja ho fa: ``` WHERE ( ze.dated = ? OR ? BETWEEN ze.started AND ze.ended OR ze.weekDays & (1 << WEEKDAY(?)) ) ``` pq depen del camps q tinga rellenats es un type o altre.
Author
Contributor

Vale res, he vist q pot tindre started, ended y weekDays rellenat. Pensava q eren exclusius.

Vale res, he vist q pot tindre started, ended y weekDays rellenat. Pensava q eren exclusius.
vicent marked this conversation as resolved
@ -54,0 +50,4 @@
)
AND z.id IN (?)
ORDER BY type='day' DESC, type='range' DESC, type='indefinitely' DESC) z
GROUP BY z.id;`;
Owner

N'hi ha una tabulació de mes en tota la consulta, punt i coma no fa falta al final si nomes es una consulta.

N'hi ha una tabulació de mes en tota la consulta, punt i coma no fa falta al final si nomes es una consulta.
vicent marked this conversation as resolved
vicent added 1 commit 2023-01-27 08:00:44 +00:00
gitea/salix/pipeline/head This commit looks good Details
f7969c616c
fix: tiene el cuenta zonEvent.type
vicent requested review from juan 2023-01-27 08:00:49 +00:00
vicent added 1 commit 2023-01-27 08:01:14 +00:00
juan approved these changes 2023-02-03 12:10:07 +00:00
vicent added 2 commits 2023-02-03 12:26:05 +00:00
vicent requested review from alexm 2023-02-03 12:26:28 +00:00
alexm approved these changes 2023-02-03 12:28:25 +00:00
vicent merged commit 065f91afcf into dev 2023-02-03 12:28:36 +00:00
vicent deleted branch 4873-zone.delivery-day 2023-02-03 12:28:37 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#1248
No description provided.