Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Monthly#106

Merged
akiomik merged 8 commits intodevelopmentfrom
monthly
Jan 13, 2023
Merged

Monthly#106
akiomik merged 8 commits intodevelopmentfrom
monthly

Conversation

@akiomik
Copy link
Copy Markdown
Contributor

@akiomik akiomik commented Dec 24, 2022

月次エンドポイント GET /api/v3/monthly をサポートするようにします。

ネストしたオブジェクト (beta) のアクセスはサポートしていますが、配列 (kpi) のサポートはしていません。

@akiomik akiomik added the enhancement New feature or request label Dec 24, 2022
@akiomik akiomik self-assigned this Dec 24, 2022
}

static columnDescriptionKey(): string {
return `${this.prefix}-column-description`
Copy link
Copy Markdown
Contributor Author

@akiomik akiomik Dec 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

column_description のスキーマは kpi の個数によって左右されないので、他のエンドポイントと同じくすべてのエンドポイントで共通

{
  "kpi":{
    "name":{"name_jp":"指標","unit":"なし"},
    "value":{"name_jp":"","unit":"指標による"}
  }
}

}

if (Array.isArray(value)) {
throw new TypeError(`An array property is currently not supported`)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配列 (kpi) へのアクセスはエラーにする

Comment on lines +22 to +24
if (isObject(value) || Array.isArray(value)) {
throw new TypeError(`Can't access to a non-primitive type`)
}
Copy link
Copy Markdown
Contributor Author

@akiomik akiomik Dec 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

指定された科目がオブジェクトや配列だった場合はエラー扱いにする (e.g. beta.years_2kpi など)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beta.years_2.beta みたいに指定する必要があるってことですね

@akiomik akiomik requested review from shoe116 and t2h5 December 26, 2022 02:04
Copy link
Copy Markdown
Contributor

@t2h5 t2h5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +22 to +24
if (isObject(value) || Array.isArray(value)) {
throw new TypeError(`Can't access to a non-primitive type`)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beta.years_2.beta みたいに指定する必要があるってことですね

return path.split('.')
}

static listPathsOf(data: object, prefix: string | null = null): string[] {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

パスのバリデーション用に作ったサポートしているプロパティを列挙するためのメソッドですが、値の取得時にも再帰する必要があり2回同じことをするのは無駄なので結局使ってません… (デバッグ用としては使えるかもですが)

Copy link
Copy Markdown
Contributor

@shoe116 shoe116 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM、 monthly だけ object の parse をサポートする、と

}

private static joinPath(...components: string[]): string {
return components.join('.')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. でつなげると。

@akiomik akiomik merged commit 2fda28b into development Jan 13, 2023
@akiomik akiomik deleted the monthly branch January 13, 2023 06:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants