update license structures and init to setup image uploader

This commit is contained in:
2026-04-16 22:19:46 +03:30
parent 28575bd3d1
commit ac23d47b79
36 changed files with 379 additions and 142 deletions
@@ -28,8 +28,8 @@ export class ConsumersComponent extends AbstractList<IConsumerResponse> {
field: 'license_expires_at',
header: 'تاریخ انقضای لایسنس',
customDataModel(item) {
if (item.license) {
return formatJalali(item.license.expires_at);
if (item.license_info) {
return formatJalali(item.license_info.expires_at);
}
return 'بدون لایسنس';
},
@@ -42,7 +42,7 @@
<superAdmin-consumer-license-form
[(visible)]="visibleLicenseForm"
[editMode]="!!licenseStatus()"
[editMode]="!!license()?.id"
[consumerId]="consumerId()"
[licenseId]="license()?.id"
[initialValues]="license() || undefined"
@@ -37,12 +37,16 @@ export class ConsumerComponent {
readonly loading = computed(() => this.store.loading());
readonly consumer = computed(() => this.store.entity());
readonly license = computed(() => this.store.entity()?.license);
readonly license = computed(() => this.store.entity()?.license_info);
readonly licenseStatus = computed(() => {
if (!this.store.entity()?.license?.expires_at) {
console.log(this.store.entity()?.license_info?.expires_at);
if (!this.store.entity()?.license_info?.expires_at) {
return null;
}
if (new Date().getTime() > new Date(this.store.entity()?.license?.expires_at || '').getTime()) {
if (
new Date().getTime() > new Date(this.store.entity()?.license_info?.expires_at || '').getTime()
) {
return licenseStatus.EXPIRED;
}
return licenseStatus.ACTIVE;