# -*- coding: utf-8 -*-
from __future__ import annotations

import uuid

import factory

from hotpocket_backend.apps.accounts.models import AccessToken


def AccessTokenMetaFactory() -> dict:
    return {
        'platform': 'MacIntel',
        'version': '1985.12.12',
    }


class AccessTokenFactory(factory.django.DjangoModelFactory):
    account_uuid = None
    key = factory.LazyFunction(lambda: str(uuid.uuid4()))
    origin = factory.LazyFunction(
        lambda: f'safari-web-extension://{uuid.uuid4()}',
    )
    meta = factory.LazyFunction(AccessTokenMetaFactory)

    class Meta:
        model = AccessToken
