Skip to content

Commit

Permalink
Merge pull request #334 from RJ-SMTR/feat/322-show-blank-weekdays
Browse files Browse the repository at this point in the history
(prod) Feat/322 show blank weekdays
  • Loading branch information
williamfl2007 committed Jul 8, 2024
2 parents 8a16e52 + 57ac8ad commit 8abb854
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-cct",
"version": "0.11.4",
"version": "0.11.5",
"description": "",
"author": "",
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions src/database/migrations/1719949229037-conference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Conference1719949229037 implements MigrationInterface {
await queryRunner.query(`CREATE TABLE "header_lote_conf" ("id" SERIAL NOT NULL, "loteServico" integer, "tipoInscricao" character varying, "numeroInscricao" character varying, "codigoConvenioBanco" character varying, "tipoCompromisso" character varying, "parametroTransmissao" character varying, "formaLancamento" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "headerArquivoId" integer, "pagadorId" integer, CONSTRAINT "PK_HeaderLoteConf_id" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "detalhe_a_conf" ("id" SERIAL NOT NULL, "ocorrenciasCnab" character varying(30), "loteServico" integer, "finalidadeDOC" character varying, "numeroDocumentoEmpresa" integer NOT NULL, "dataVencimento" TIMESTAMP, "tipoMoeda" character varying, "quantidadeMoeda" numeric(10,5), "valorLancamento" numeric(13,2), "numeroDocumentoBanco" character varying, "quantidadeParcelas" integer, "indicadorBloqueio" character varying, "indicadorFormaParcelamento" character varying, "periodoVencimento" TIMESTAMP, "numeroParcela" integer, "dataEfetivacao" TIMESTAMP, "valorRealEfetivado" numeric(13,2), "nsr" integer NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "headerLoteId" integer, "clienteFavorecidoId" integer, "itemTransacaoAgrupadoId" integer NOT NULL, CONSTRAINT "REL_5a006e496627c740a941d4b48a" UNIQUE ("itemTransacaoAgrupadoId"), CONSTRAINT "PK_DetalheAConf_id" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "detalhe_b_conf" ("id" SERIAL NOT NULL, "nsr" integer NOT NULL, "dataVencimento" TIMESTAMP NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "detalheAId" integer, CONSTRAINT "REL_ed5fc663251f22dd7bb9bd9c18" UNIQUE ("detalheAId"), CONSTRAINT "PK_DetalheBConf_id" PRIMARY KEY ("id"))`);
await queryRunner.query(`ALTER TABLE "file" ALTER COLUMN "id" SET DEFAULT uuid_generate_v4()`);
// await queryRunner.query(`ALTER TABLE "file" ALTER COLUMN "id" SET DEFAULT uuid_generate_v4()`);
// await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_User_photo_ManyToOne" FOREIGN KEY ("photoId") REFERENCES "file"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "header_arquivo_conf" ADD CONSTRAINT "FK_HeaderArquivoConf_transacao_ManyToOne" FOREIGN KEY ("transacaoId") REFERENCES "transacao"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "header_arquivo_conf" ADD CONSTRAINT "FK_HeaderArquivoConf_transacaoAgrupado_ManyToOne" FOREIGN KEY ("transacaoAgrupadoId") REFERENCES "transacao_agrupado"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
Expand All @@ -30,7 +30,7 @@ export class Conference1719949229037 implements MigrationInterface {
await queryRunner.query(`ALTER TABLE "header_arquivo_conf" DROP CONSTRAINT "FK_HeaderArquivoConf_transacaoAgrupado_ManyToOne"`);
await queryRunner.query(`ALTER TABLE "header_arquivo_conf" DROP CONSTRAINT "FK_HeaderArquivoConf_transacao_ManyToOne"`);
// await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_User_photo_ManyToOne"`);
await queryRunner.query(`ALTER TABLE "file" ALTER COLUMN "id" DROP DEFAULT`);
// await queryRunner.query(`ALTER TABLE "file" ALTER COLUMN "id" DROP DEFAULT`);
await queryRunner.query(`DROP TABLE "detalhe_b_conf"`);
await queryRunner.query(`DROP TABLE "detalhe_a_conf"`);
await queryRunner.query(`DROP TABLE "header_lote_conf"`);
Expand Down
11 changes: 8 additions & 3 deletions src/ticket-revenues/ticket-revenues.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class TicketRevenuesService {
private readonly transacaoViewService: TransacaoViewService,
private readonly arrquivoPublicacaoService: ArquivoPublicacaoService,
private readonly detalheAService: DetalheAService,
) {}
) { }

/**
* TODO: refactor - use repository method
Expand Down Expand Up @@ -139,7 +139,12 @@ export class TicketRevenuesService {
todaySum: 0,
count: 0,
ticketCount: 0,
data: [],
data: this.fillDatesInGroups(
[],
groupBy,
startDate,
endDate,
),
};
}

Expand Down Expand Up @@ -380,7 +385,7 @@ export class TicketRevenuesService {
).toISOString();
const day = item.processingDateTime;
const procsesingDate = groupBy === 'week' ? friday : day;
const newGroup = new TicketRevenuesGroupDto({
const newGroup = new TicketRevenuesGroupDto({
count: 0,
date: procsesingDate,
transportTypeCounts: {},
Expand Down

0 comments on commit 8abb854

Please sign in to comment.